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 unique constraint for department name within company

Brad Barbindaea53b3d158
diff --git a/packages/database/supabase/migrations/20250417101025_department-name-constraint.sql b/packages/database/supabase/migrations/20250417101025_department-name-constraint.sql
new file mode 100644
index 0000000000..da7417c189
--- /dev/null
+++ b/packages/database/supabase/migrations/20250417101025_department-name-constraint.sql
@@ -0,0 +1 @@
+ALTER TABLE "department" ADD CONSTRAINT "department_name_key" UNIQUE ("name", "companyId");
\ No newline at end of file