Skip to content

Commit

Permalink
Make normalized_node_id optional (#159)
Browse files Browse the repository at this point in the history
Co-authored-by: James Kwon <[email protected]>
  • Loading branch information
james03160927 and james03160927 authored Feb 2, 2025
1 parent 09822a8 commit b8e4e46
Show file tree
Hide file tree
Showing 8 changed files with 80 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- Modify "nodes" table
ALTER TABLE "nodes" ADD COLUMN "normalized_id" text NOT NULL;
ALTER TABLE "nodes" ADD COLUMN "normalized_id" text NULL;
-- Create index "nodes_normalized_id_key" to table: "nodes"
CREATE UNIQUE INDEX "nodes_normalized_id_key" ON "nodes" ("normalized_id");
4 changes: 2 additions & 2 deletions ent/migrate/migrations/atlas.sum
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
h1:FMpCbSICEXr2hUQTRNNhgLf+F07Ovzn570ZLNyo3gPI=
h1:XGnS8fZVhqC9/CRJB76OOslOYu0Wzr6YQtVCCkqLTWU=
20240526144817_migration.sql h1:sP6keX+oMyLL2qpIFx0Ns0WYfWM5hJ4zkFPmLWT68fM=
20240528220411_migration.sql h1:SR44sOEaWbDgYCKJZIKcGCI7Ta+LqL71z225Nhs2+HM=
20240528221846_migration.sql h1:EkUonGI9Bu689qWX4pG3PRC+On4f6u7UvwDbaR8mCNk=
Expand All @@ -24,4 +24,4 @@ h1:FMpCbSICEXr2hUQTRNNhgLf+F07Ovzn570ZLNyo3gPI=
20250111220145_migration.sql h1:r5D0DeFYV4llyfBcD2BPzHacDWGWfVNe0nVrKwfWgJE=
20250113223458_migration.sql h1:/y9TETVsoKY2x0+rhT1DjTVJV/LghpK/RW4RMEhoVY0=
20250123210944_migration.sql h1:rgKGRZPgTXXBX7RUxEKDpk3X8MbDqJiU5981dg7bbbU=
20250128011017_migration.sql h1:mZI4EHavmrnqX/GW5S9wW1PpGxoo39Kwd7fH5TB04Lg=
20250202152731_migration.sql h1:j01qWkUwUQd91DqlFG/ewOIaX5ELDIgK2IcEFIUCslo=
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: 19 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.

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

0 comments on commit b8e4e46

Please sign in to comment.