@@ -228,8 +228,11 @@ var (
228228 CREATE VIEW schema_filtered_1.foo_view AS
229229 SELECT id, author
230230 FROM schema_2.foo;
231+
232+ -- Add a column with a default to test HasMissingValOptimization
233+ ALTER TABLE schema_2.foo ADD COLUMN added_col TEXT DEFAULT 'some_default';
231234 ` },
232- expectedHash : "ff9ed400558572aa " ,
235+ expectedHash : "386c0eb7ee3f4874 " ,
233236 expectedSchema : Schema {
234237 NamedSchemas : []NamedSchema {
235238 {Name : "public" },
@@ -271,6 +274,7 @@ var (
271274 {Name : "content" , Type : "text" , Default : "''::text" , Size : - 1 , Collation : defaultCollation },
272275 {Name : "created_at" , Type : "timestamp without time zone" , Default : "CURRENT_TIMESTAMP" , Size : 8 },
273276 {Name : "version" , Type : "integer" , Default : "0" , Size : 4 },
277+ {Name : "added_col" , Type : "text" , Default : "'some_default'::text" , IsNullable : true , Size : - 1 , Collation : defaultCollation , HasMissingValOptimization : true },
274278 },
275279 CheckConstraints : []CheckConstraint {
276280 {Name : "author_content_check" , Expression : "((length(content) > 0) AND (length(author) > 0))" , KeyColumns : []string {"author" , "content" }},
@@ -571,7 +575,7 @@ var (
571575 ALTER TABLE foo_fk_1 ADD CONSTRAINT foo_fk_1_fk FOREIGN KEY (author, content) REFERENCES foo_1 (author, content)
572576 NOT VALID;
573577 ` },
574- expectedHash : "9647ef46a878d426 " ,
578+ expectedHash : "1f2c44c4589a8d6a " ,
575579 expectedSchema : Schema {
576580 NamedSchemas : []NamedSchema {
577581 {Name : "public" },
@@ -606,7 +610,7 @@ var (
606610 {Name : "content" , Type : "text" , Default : "''::text" , Size : - 1 , Collation : defaultCollation },
607611 {Name : "genre" , Type : "character varying(256)" , Size : - 1 , Collation : defaultCollation },
608612 {Name : "created_at" , Type : "timestamp without time zone" , Default : "CURRENT_TIMESTAMP" , Size : 8 },
609- {Name : "version" , Type : "integer" , IsNullable : false , , Size : 4 },
613+ {Name : "version" , Type : "integer" , Size : 4 },
610614 },
611615 CheckConstraints : nil ,
612616 ReplicaIdentity : ReplicaIdentityNothing ,
0 commit comments