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: duplicate custom view names across companies

Brad Barbinf2825c7deebb
diff --git a/packages/database/supabase/migrations/20250805123358_table-view-duplicate-fix.sql b/packages/database/supabase/migrations/20250805123358_table-view-duplicate-fix.sql
index e69de29bb2..65956103be 100644
--- a/packages/database/supabase/migrations/20250805123358_table-view-duplicate-fix.sql
+++ b/packages/database/supabase/migrations/20250805123358_table-view-duplicate-fix.sql
@@ -0,0 +1,3 @@
+ALTER TABLE "tableView" DROP CONSTRAINT IF EXISTS "tableView_name_table_createdBy_key";
+
+ALTER TABLE "tableView" ADD CONSTRAINT "tableView_name_table_createdBy_companyId_key" UNIQUE ("name", "table", "createdBy", "companyId");