chore: Add tripId field to Adventure interface and schema

This commit is contained in:
Sean Morley
2024-05-15 21:06:01 +00:00
parent a0400bca8e
commit b94fdc7107
6 changed files with 544 additions and 3 deletions

View File

@@ -0,0 +1,8 @@
ALTER TABLE "adventures" ADD COLUMN "tripId" integer;--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "adventures" ADD CONSTRAINT "adventures_tripId_userPlannedTrips_id_fk" FOREIGN KEY ("tripId") REFERENCES "userPlannedTrips"("id") ON DELETE no action ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint
ALTER TABLE "userPlannedTrips" DROP COLUMN IF EXISTS "adventures";