Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

fix: add transaction

Brad Barbin5c94582ac4f3
diff --git a/packages/database/supabase/migrations/20250314184246_opportunity-refactor.sql b/packages/database/supabase/migrations/20250314184246_opportunity-refactor.sql
index a96ab09e59..bc10828a33 100644
--- a/packages/database/supabase/migrations/20250314184246_opportunity-refactor.sql
+++ b/packages/database/supabase/migrations/20250314184246_opportunity-refactor.sql
@@ -1,3 +1,5 @@
+BEGIN;
+
ALTER TABLE "quote" ADD COLUMN "opportunityId" TEXT;
ALTER TABLE "quote" ADD COLUMN "completedDate" TIMESTAMPTZ;
ALTER TABLE "quote" ADD CONSTRAINT "quote_opportunityId_fkey" FOREIGN KEY ("opportunityId") REFERENCES "opportunity"("id") ON DELETE SET NULL;
@@ -298,3 +300,5 @@ EXCEPTION
RAISE;
END;
$$;
+
+COMMIT;