Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions packages/db/migrations/0021_rename_section_id_to_meeting_id.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
ALTER TABLE "websoc_section_meeting_to_location" RENAME COLUMN "section_id" TO "meeting_id";--> statement-breakpoint
ALTER TABLE "websoc_section_meeting_to_location" DROP CONSTRAINT "websoc_section_meeting_to_location_section_id_websoc_section_meeting_id_fk";
--> statement-breakpoint
DROP INDEX IF EXISTS "websoc_section_meeting_to_location_section_id_index";--> statement-breakpoint
DROP INDEX IF EXISTS "websoc_section_meeting_to_location_section_id_location_id_index";--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "websoc_section_meeting_to_location" ADD CONSTRAINT "websoc_section_meeting_to_location_meeting_id_websoc_section_meeting_id_fk" FOREIGN KEY ("meeting_id") REFERENCES "public"."websoc_section_meeting"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint
CREATE INDEX IF NOT EXISTS "websoc_section_meeting_to_location_meeting_id_index" ON "websoc_section_meeting_to_location" USING btree ("meeting_id");--> statement-breakpoint
CREATE UNIQUE INDEX IF NOT EXISTS "websoc_section_meeting_to_location_meeting_id_location_id_index" ON "websoc_section_meeting_to_location" USING btree ("meeting_id","location_id");
Loading
Loading