@@ -469,7 +469,7 @@ var (
469
469
content TEXT DEFAULT '',
470
470
genre VARCHAR(256) NOT NULL,
471
471
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP CHECK (created_at > CURRENT_TIMESTAMP - interval '1 month'),
472
- version INT NOT NULL DEFAULT 0 ,
472
+ version INT GENERATED ALWAYS AS IDENTITY ,
473
473
PRIMARY KEY (author, id)
474
474
) PARTITION BY LIST (author);
475
475
ALTER TABLE foo ADD CONSTRAINT author_check CHECK (author IS NOT NULL AND LENGTH(author) > 0) NOT VALID;
@@ -524,7 +524,7 @@ var (
524
524
ALTER TABLE foo_fk_1 ADD CONSTRAINT foo_fk_1_fk FOREIGN KEY (author, content) REFERENCES foo_1 (author, content)
525
525
NOT VALID;
526
526
` },
527
- expectedHash : "cf473d75363e9f77 " ,
527
+ expectedHash : "38588fed86b25fd " ,
528
528
expectedSchema : Schema {
529
529
NamedSchemas : []NamedSchema {
530
530
{Name : "public" },
@@ -538,7 +538,9 @@ var (
538
538
{Name : "content" , Type : "text" , Default : "''::text" , IsNullable : true , Size : - 1 , Collation : defaultCollation },
539
539
{Name : "genre" , Type : "character varying(256)" , Size : - 1 , Collation : defaultCollation },
540
540
{Name : "created_at" , Type : "timestamp without time zone" , Default : "CURRENT_TIMESTAMP" , Size : 8 },
541
- {Name : "version" , Type : "integer" , Default : "0" , Size : 4 },
541
+ {Name : "version" , Type : "integer" , Size : 4 ,
542
+ Identity : & ColumnIdentity {Type : "a" , MinValue : 1 , MaxValue : 2147483647 , StartValue : 1 , Increment : 1 , CacheSize : 1 , Cycle : false },
543
+ },
542
544
},
543
545
CheckConstraints : []CheckConstraint {
544
546
{Name : "author_check" , Expression : "((author IS NOT NULL) AND (length(author) > 0))" , IsInheritable : true , KeyColumns : []string {"author" }},
@@ -557,7 +559,7 @@ var (
557
559
{Name : "content" , Type : "text" , Default : "''::text" , Size : - 1 , Collation : defaultCollation },
558
560
{Name : "genre" , Type : "character varying(256)" , Size : - 1 , Collation : defaultCollation },
559
561
{Name : "created_at" , Type : "timestamp without time zone" , Default : "CURRENT_TIMESTAMP" , Size : 8 },
560
- {Name : "version" , Type : "integer" , Default : "0" , Size : 4 },
562
+ {Name : "version" , Type : "integer" , IsNullable : false , Size : 4 },
561
563
},
562
564
CheckConstraints : nil ,
563
565
ReplicaIdentity : ReplicaIdentityNothing ,
@@ -572,7 +574,7 @@ var (
572
574
{Name : "content" , Type : "text" , Default : "''::text" , IsNullable : true , Size : - 1 , Collation : defaultCollation },
573
575
{Name : "genre" , Type : "character varying(256)" , Size : - 1 , Collation : defaultCollation },
574
576
{Name : "created_at" , Type : "timestamp without time zone" , Default : "CURRENT_TIMESTAMP" , Size : 8 },
575
- {Name : "version" , Type : "integer" , Default : "0" , Size : 4 },
577
+ {Name : "version" , Type : "integer" , IsNullable : false , Size : 4 },
576
578
},
577
579
CheckConstraints : nil ,
578
580
ReplicaIdentity : ReplicaIdentityDefault ,
@@ -587,7 +589,7 @@ var (
587
589
{Name : "content" , Type : "text" , Default : "''::text" , IsNullable : true , Size : - 1 , Collation : defaultCollation },
588
590
{Name : "genre" , Type : "character varying(256)" , Size : - 1 , Collation : defaultCollation },
589
591
{Name : "created_at" , Type : "timestamp without time zone" , Default : "CURRENT_TIMESTAMP" , Size : 8 },
590
- {Name : "version" , Type : "integer" , Default : "0" , Size : 4 },
592
+ {Name : "version" , Type : "integer" , IsNullable : false , Size : 4 },
591
593
},
592
594
CheckConstraints : nil ,
593
595
ReplicaIdentity : ReplicaIdentityDefault ,
0 commit comments