feat: board slugs

This commit is contained in:
Henry
2025-01-05 16:21:11 +00:00
parent fa9be9d280
commit d98df1d2c6
13 changed files with 1795 additions and 60 deletions

View File

@@ -0,0 +1,12 @@
-- First add the columns without NOT NULL constraint
ALTER TABLE "board" ADD COLUMN "description" text;--> statement-breakpoint
ALTER TABLE "board" ADD COLUMN "slug" varchar(255);--> statement-breakpoint
-- Update existing records with a default slug (using board id to ensure uniqueness)
UPDATE "board" SET "slug" = 'board-' || id::text;--> statement-breakpoint
-- Now add the NOT NULL constraint
ALTER TABLE "board" ALTER COLUMN "slug" SET NOT NULL;--> statement-breakpoint
-- Finally create the unique index
CREATE UNIQUE INDEX IF NOT EXISTS "unique_slug_per_workspace" ON "board" USING btree ("workspaceId","slug");

File diff suppressed because it is too large Load Diff

View File

@@ -29,6 +29,13 @@
"when": 1736084845433,
"tag": "0003_fine_bedlam",
"breakpoints": true
},
{
"idx": 4,
"version": "7",
"when": 1736087559461,
"tag": "0004_eminent_living_mummy",
"breakpoints": true
}
]
}