Skip to content

Commit e1241a0

Browse files
committed
chore(db): regenerate kb→workspace cascade migration as 0243
Regenerated via drizzle-kit generate on top of the merged staging migrations (staging took 0242). Re-applied the safety edits: NOT VALID + separate VALIDATE on the FK re-add, and the -- migration-safe note on the DROP. check:migrations passes.
1 parent 81622fb commit e1241a0

3 files changed

Lines changed: 16742 additions & 0 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
-- migration-safe: re-creates the existing knowledge_base→workspace FK only to change its ON DELETE action to cascade. The column and FK are otherwise unchanged and the FK is re-added immediately below (atomic within the migration transaction); no app code depends on the FK's delete action.
2+
ALTER TABLE "knowledge_base" DROP CONSTRAINT "knowledge_base_workspace_id_workspace_id_fk";
3+
--> statement-breakpoint
4+
ALTER TABLE "knowledge_base" ADD CONSTRAINT "knowledge_base_workspace_id_workspace_id_fk" FOREIGN KEY ("workspace_id") REFERENCES "public"."workspace"("id") ON DELETE cascade ON UPDATE no action NOT VALID;
5+
--> statement-breakpoint
6+
ALTER TABLE "knowledge_base" VALIDATE CONSTRAINT "knowledge_base_workspace_id_workspace_id_fk";

0 commit comments

Comments
 (0)