Skip to content

Commit ea3852a

Browse files
authored
Require Slugs for Organizations and Posts (#27)
* refactor(schema): require that org and project slugs are not null * refactor(schema): adjust tables to use hidra ID for foreign key relations * build: update to use JSONC formatted lockfile * Revert "refactor(schema): adjust tables to use hidra ID for foreign key relations" This reverts commit aeff338. * refactor: apply migrations
1 parent 0e065e5 commit ea3852a

File tree

8 files changed

+1241
-16
lines changed

8 files changed

+1241
-16
lines changed

bun.lock

Lines changed: 573 additions & 0 deletions
Large diffs are not rendered by default.

bun.lockb

-97.3 KB
Binary file not shown.

src/generated/graphql/schema.executable.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ const spec_userOrganization = {
120120
}),
121121
description: undefined,
122122
extensions: {
123-
oid: "92823",
123+
oid: "81017",
124124
isTableLike: true,
125125
pg: {
126126
serviceName: "main",
@@ -200,7 +200,7 @@ const spec_downvote = {
200200
}),
201201
description: undefined,
202202
extensions: {
203-
oid: "92888",
203+
oid: "81082",
204204
isTableLike: true,
205205
pg: {
206206
serviceName: "main",
@@ -280,7 +280,7 @@ const spec_upvote = {
280280
}),
281281
description: undefined,
282282
extensions: {
283-
oid: "92801",
283+
oid: "80995",
284284
isTableLike: true,
285285
pg: {
286286
serviceName: "main",
@@ -324,7 +324,7 @@ const spec_organization = {
324324
slug: {
325325
description: undefined,
326326
codec: TYPES.text,
327-
notNull: false,
327+
notNull: true,
328328
hasDefault: false,
329329
extensions: {
330330
tags: {},
@@ -360,7 +360,7 @@ const spec_organization = {
360360
}),
361361
description: undefined,
362362
extensions: {
363-
oid: "92763",
363+
oid: "80957",
364364
isTableLike: true,
365365
pg: {
366366
serviceName: "main",
@@ -452,7 +452,7 @@ const spec_comment = {
452452
}),
453453
description: undefined,
454454
extensions: {
455-
oid: "92868",
455+
oid: "81062",
456456
isTableLike: true,
457457
pg: {
458458
serviceName: "main",
@@ -556,7 +556,7 @@ const spec_post = {
556556
}),
557557
description: undefined,
558558
extensions: {
559-
oid: "92777",
559+
oid: "80971",
560560
isTableLike: true,
561561
pg: {
562562
serviceName: "main",
@@ -612,7 +612,7 @@ const spec_project = {
612612
slug: {
613613
description: undefined,
614614
codec: TYPES.text,
615-
notNull: false,
615+
notNull: true,
616616
hasDefault: false,
617617
extensions: {
618618
tags: {},
@@ -672,7 +672,7 @@ const spec_project = {
672672
}),
673673
description: undefined,
674674
extensions: {
675-
oid: "92787",
675+
oid: "80981",
676676
isTableLike: true,
677677
pg: {
678678
serviceName: "main",
@@ -776,7 +776,7 @@ const spec_user = {
776776
}),
777777
description: undefined,
778778
extensions: {
779-
oid: "92811",
779+
oid: "81005",
780780
isTableLike: true,
781781
pg: {
782782
serviceName: "main",
@@ -4628,7 +4628,7 @@ type Organization implements Node {
46284628
id: ID!
46294629
rowId: UUID!
46304630
name: String
4631-
slug: String
4631+
slug: String!
46324632
createdAt: Datetime
46334633
updatedAt: Datetime
46344634

@@ -4742,7 +4742,7 @@ type Project implements Node {
47424742
rowId: UUID!
47434743
name: String
47444744
image: String
4745-
slug: String
4745+
slug: String!
47464746
description: String
47474747
organizationId: UUID!
47484748
createdAt: Datetime
@@ -8336,7 +8336,7 @@ input CreateOrganizationInput {
83368336
input OrganizationInput {
83378337
rowId: UUID
83388338
name: String
8339-
slug: String
8339+
slug: String!
83408340
createdAt: Datetime
83418341
updatedAt: Datetime
83428342
}
@@ -8518,7 +8518,7 @@ input ProjectInput {
85188518
rowId: UUID
85198519
name: String
85208520
image: String
8521-
slug: String
8521+
slug: String!
85228522
description: String
85238523
organizationId: UUID!
85248524
createdAt: Datetime
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ALTER TABLE "organization" ALTER COLUMN "slug" SET NOT NULL;--> statement-breakpoint
2+
ALTER TABLE "project" ALTER COLUMN "slug" SET NOT NULL;

0 commit comments

Comments
 (0)