server/drizzle/0013_wandering_celestials.sql
2024-04-16 21:04:03 -10:00

8 lines
410 B
SQL

ALTER TABLE "Markers" ALTER COLUMN "userId" SET NOT NULL;--> statement-breakpoint
ALTER TABLE "Markers" ADD COLUMN "notificationId" uuid;--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "Markers" ADD CONSTRAINT "Markers_notificationId_Notifications_id_fk" FOREIGN KEY ("notificationId") REFERENCES "Notifications"("id") ON DELETE cascade ON UPDATE cascade;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;