Skip to content

Commit

Permalink
attach migration and id should not be null
Browse files Browse the repository at this point in the history
  • Loading branch information
shivam-sharma7 committed Sep 12, 2024
1 parent 6c2ad0f commit 00f1ef5
Show file tree
Hide file tree
Showing 4 changed files with 413 additions and 2 deletions.
15 changes: 15 additions & 0 deletions server/db/migrations/0008_open_quentin_quire.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
CREATE TABLE IF NOT EXISTS "review_tags" (
"id" serial PRIMARY KEY NOT NULL,
"title" varchar(8) NOT NULL,
"parent" smallint NOT NULL
);
--> statement-breakpoint
ALTER TABLE "posting_applicants" DROP CONSTRAINT "posting_applicants_owner_id_users_id_fk";
--> statement-breakpoint
ALTER TABLE "posting_applicants" ALTER COLUMN "owner_id" SET NOT NULL;--> statement-breakpoint
ALTER TABLE "posting_applicants" ALTER COLUMN "job_id" SET NOT NULL;--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "posting_applicants" ADD CONSTRAINT "posting_applicants_owner_id_users_id_fk" FOREIGN KEY ("owner_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
Loading

0 comments on commit 00f1ef5

Please sign in to comment.