word: declare postgresql sequences as identities
authorMischa POSLAWSKY <perl@shiar.org>
Sun, 23 Oct 2022 22:29:26 +0000 (00:29 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Thu, 9 Feb 2023 17:54:07 +0000 (18:54 +0100)
tools/word.pg.sql

index 9f6bd41769a1b715b8f81f45f1dffb7254b15248..7f97ada4c58ebd947ed27083d5c49863128f20d4 100644 (file)
@@ -4,7 +4,7 @@ CREATE TABLE login (
        email      text,
        fullname   text,
        editlang   text[],
-       id         serial      NOT NULL PRIMARY KEY
+       id         integer     NOT NULL PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY
 );
 
 CREATE TABLE word (
@@ -24,7 +24,7 @@ CREATE TABLE word (
        creator    integer              REFERENCES login (id),
        created    timestamptz          DEFAULT now(),
        updated    timestamptz,
-       id         serial      NOT NULL PRIMARY KEY
+       id         integer     NOT NULL PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY
 );
 
 COMMENT ON COLUMN word.form       IS 'preferred textual representation';
@@ -49,7 +49,7 @@ CREATE TABLE kind (
        creator    integer              REFERENCES login (id),
        created    timestamptz          DEFAULT now(),
        updated    timestamptz,
-       id         serial      NOT NULL PRIMARY KEY
+       id         integer     NOT NULL PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY
 );
 
 COMMENT ON COLUMN kind.truth      IS 'link validity ranging from 0 (never) to 100 (always)';