Skip to content

Commit

Permalink
Change normalized_id field to mandatory (#160)
Browse files Browse the repository at this point in the history
* Change normalized_id field to mandatory

* add atlas migration file

---------

Co-authored-by: James Kwon <[email protected]>
  • Loading branch information
james03160927 and james03160927 authored Feb 2, 2025
1 parent b8e4e46 commit fd60810
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 78 deletions.
2 changes: 2 additions & 0 deletions ent/migrate/migrations/20250202155247_migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- Modify "nodes" table
ALTER TABLE "nodes" ALTER COLUMN "normalized_id" SET NOT NULL;
3 changes: 2 additions & 1 deletion ent/migrate/migrations/atlas.sum
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
h1:XGnS8fZVhqC9/CRJB76OOslOYu0Wzr6YQtVCCkqLTWU=
h1:PtKdy0JKL4u+W7c4bkDBsyO9x6EDzT9ldCC1uVWNbNQ=
20240526144817_migration.sql h1:sP6keX+oMyLL2qpIFx0Ns0WYfWM5hJ4zkFPmLWT68fM=
20240528220411_migration.sql h1:SR44sOEaWbDgYCKJZIKcGCI7Ta+LqL71z225Nhs2+HM=
20240528221846_migration.sql h1:EkUonGI9Bu689qWX4pG3PRC+On4f6u7UvwDbaR8mCNk=
Expand All @@ -25,3 +25,4 @@ h1:XGnS8fZVhqC9/CRJB76OOslOYu0Wzr6YQtVCCkqLTWU=
20250113223458_migration.sql h1:/y9TETVsoKY2x0+rhT1DjTVJV/LghpK/RW4RMEhoVY0=
20250123210944_migration.sql h1:rgKGRZPgTXXBX7RUxEKDpk3X8MbDqJiU5981dg7bbbU=
20250202152731_migration.sql h1:j01qWkUwUQd91DqlFG/ewOIaX5ELDIgK2IcEFIUCslo=
20250202155247_migration.sql h1:IKFoZa4IP+ShR0fitNqQgJrlxjeL3oxBhFgF1jOn1eI=
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.

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

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

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

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

31 changes: 3 additions & 28 deletions ent/node_create.go

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

18 changes: 0 additions & 18 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 @@ -21,7 +21,7 @@ func (Node) Fields() []ent.Field {
}).Unique(),
field.String("normalized_id").SchemaType(map[string]string{
dialect.Postgres: "text",
}).Unique().Optional(),
}).Unique(),
field.String("publisher_id").SchemaType(map[string]string{
dialect.Postgres: "text",
}),
Expand Down

0 comments on commit fd60810

Please sign in to comment.