~jan0sch/smederee

Showing details for patch 4b41213b0d36857c93998adbd588a4e3540ffa88.
2024-06-18 (Tue), 12:47 PM - Jens Grassel - 4b41213b0d36857c93998adbd588a4e3540ffa88

CODINGSTYLE: adjust to removal of quotes in SQL files

Summary of changes
1 files modified with 15 lines added and 15 lines removed
  • CODINGSTYLE.md with 15 added and 15 removed lines
diff -rN -u old-smederee/CODINGSTYLE.md new-smederee/CODINGSTYLE.md
--- old-smederee/CODINGSTYLE.md	2025-01-11 14:53:10.157955927 +0000
+++ new-smederee/CODINGSTYLE.md	2025-01-11 14:53:10.157955927 +0000
@@ -63,7 +63,7 @@
 
 1. All SQL keywords MUST be written in uppercase.
 2. All table, column and variable names MUST be written in lowercase.
-3. All table and column names MUST be enclosed in double quotes e.g. `"table"."column"`.
+3. All table and column names MUST NOT be quoted e.g. do not use `[table].[column]` or `"table"."column"`.
 4. Created tables MUST be described using the `COMMENT` command. This also applies to each column of a table.
 5. A `COMMENT` statement SHALL NOT be wrapped even if it exceeds 80 characters.
 6. A `CREATE TABLE` statement MUST be split over multiple lines to have the `CREATE TABLE`, the starting parenthesis, each column and constraint and the closing parenthesis on a separate line.
@@ -74,24 +74,24 @@
 An example for a database migration SQL file looks like this:
 
 ```sql
-CREATE TABLE "sessions"
+CREATE TABLE sessions
 (
-  "id"         VARCHAR(32)              NOT NULL,
-  "uid"        UUID                     NOT NULL,
-  "created_at" TIMESTAMP WITH TIME ZONE NOT NULL,
-  "updated_at" TIMESTAMP WITH TIME ZONE NOT NULL,
-  CONSTRAINT "sessions_pk"     PRIMARY KEY ("id"),
-  CONSTRAINT "sessions_fk_uid" FOREIGN KEY ("uid")
-    REFERENCES "accounts" ("uid") ON UPDATE CASCADE ON DELETE CASCADE
+  id         VARCHAR(32)              NOT NULL,
+  uid        UUID                     NOT NULL,
+  created_at TIMESTAMP WITH TIME ZONE NOT NULL,
+  updated_at TIMESTAMP WITH TIME ZONE NOT NULL,
+  CONSTRAINT sessions_pk     PRIMARY KEY (id),
+  CONSTRAINT sessions_fk_uid FOREIGN KEY (uid)
+    REFERENCES accounts (uid) ON UPDATE CASCADE ON DELETE CASCADE
 )
 WITH (
   OIDS=FALSE
 );
 
-COMMENT ON TABLE "sessions" IS 'Keeps the sessions of users.';
-COMMENT ON COLUMN "sessions"."id" IS 'A globally unique session ID.';
-COMMENT ON COLUMN "sessions"."uid" IS 'The unique ID of the user account to whom the session belongs.';
-COMMENT ON COLUMN "sessions"."created_at" IS 'The timestamp of when the session was created.';
-COMMENT ON COLUMN "sessions"."updated_at" IS 'The session ID should be re-generated in regular intervals resulting in a copy of the old session entry with a new ID and the corresponding timestamp in this column.';
+COMMENT ON TABLE sessions IS 'Keeps the sessions of users.';
+COMMENT ON COLUMN sessions.id IS 'A globally unique session ID.';
+COMMENT ON COLUMN sessions.uid IS 'The unique ID of the user account to whom the session belongs.';
+COMMENT ON COLUMN sessions.created_at IS 'The timestamp of when the session was created.';
+COMMENT ON COLUMN sessions.updated_at IS 'The session ID should be re-generated in regular intervals resulting in a copy of the old session entry with a new ID and the corresponding timestamp in this column.';
 ```