Skip to content

Commit

Permalink
feat(schema): add missing interests table
Browse files Browse the repository at this point in the history
  • Loading branch information
Veirt committed Nov 24, 2024
1 parent e30e489 commit 9b01ba2
Show file tree
Hide file tree
Showing 4 changed files with 851 additions and 0 deletions.
16 changes: 16 additions & 0 deletions drizzle/0004_calm_william_stryker.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
CREATE TABLE IF NOT EXISTS "interests" (
"learnerId" uuid NOT NULL,
"subjectId" uuid NOT NULL
);
--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "interests" ADD CONSTRAINT "interests_learnerId_learners_id_fk" FOREIGN KEY ("learnerId") REFERENCES "public"."learners"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "interests" ADD CONSTRAINT "interests_subjectId_subjects_id_fk" FOREIGN KEY ("subjectId") REFERENCES "public"."subjects"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
Loading

0 comments on commit 9b01ba2

Please sign in to comment.