Skip to content

Commit

Permalink
Add additional migration to fix non-null statement
Browse files Browse the repository at this point in the history
  • Loading branch information
james03160927 committed May 28, 2024
1 parent b0015af commit f203ba7
Show file tree
Hide file tree
Showing 9 changed files with 76 additions and 8 deletions.
2 changes: 1 addition & 1 deletion ent/migrate/migrations/20240528220411_migration.sql
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
-- Modify "nodes" table
ALTER TABLE "nodes" ADD COLUMN "test_field" text NOT NULL;
ALTER TABLE "nodes" ADD COLUMN "test_field" text;
2 changes: 2 additions & 0 deletions ent/migrate/migrations/20240528221846_migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- Modify "nodes" table
ALTER TABLE "nodes" ALTER COLUMN "test_field" DROP NOT NULL;
5 changes: 3 additions & 2 deletions ent/migrate/migrations/atlas.sum
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
h1:qDiQeVaeKVjOjw5Yv9X/s3l4bU33dQ3QstZ/g8MJky0=
h1:7urIzJi6Lotk7EXEvhjHU0cLp0VVoy6dN9N099p3b2w=
20240526144817_migration.sql h1:sP6keX+oMyLL2qpIFx0Ns0WYfWM5hJ4zkFPmLWT68fM=
20240528220411_migration.sql h1:MWbTfx95zDNhc3BL0B4bSC959NKyxzLYGHxreKO9D2M=
20240528220411_migration.sql h1:SR44sOEaWbDgYCKJZIKcGCI7Ta+LqL71z225Nhs2+HM=
20240528221846_migration.sql h1:EkUonGI9Bu689qWX4pG3PRC+On4f6u7UvwDbaR8mCNk=
2 changes: 1 addition & 1 deletion ent/migrate/schema.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions ent/mutation.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions ent/node/where.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 20 additions & 3 deletions ent/node_create.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions ent/node_update.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ent/schema/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func (Node) Fields() []ent.Field {
}).Default([]string{}),
field.Strings("test_field").SchemaType(map[string]string{
dialect.Postgres: "text",
}).Default([]string{}),
}).Default([]string{}).Optional(),
}
}

Expand Down

0 comments on commit f203ba7

Please sign in to comment.