chore: Add tripId field to Adventure interface and schema
This commit is contained in:
8
migrations/0001_salty_ser_duncan.sql
Normal file
8
migrations/0001_salty_ser_duncan.sql
Normal 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";
|
||||
Reference in New Issue
Block a user