ALTER TABLE "energy_assessment_documents" DROP CONSTRAINT "energy_assessment_documents_scenario_id_energy_assessments_id_fk";
--> statement-breakpoint
DO $$ BEGIN
 ALTER TABLE "energy_assessment_documents" ADD CONSTRAINT "energy_assessment_documents_scenario_id_energy_assessment_scenarios_id_fk" FOREIGN KEY ("scenario_id") REFERENCES "energy_assessment_scenarios"("id") ON DELETE no action ON UPDATE no action;
EXCEPTION
 WHEN duplicate_object THEN null;
END $$;
