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.
TypeScript ai-agentsbill-of-materialserpinventory-managementleanmanufacturingmanufacturing-execution-systemmcp-servermesmrpopen-source-erppostgresqlproduction-planningqmsquality-management-systemreact-routerself-hostedsupabasetraceabilitytypescript
-- Make the customerId column nullable
ALTER TABLE "opportunity" ALTER COLUMN "customerId" DROP NOT NULL;
-- Drop the existing foreign key constraint (currently ON DELETE CASCADE)
ALTER TABLE "opportunity" DROP CONSTRAINT IF EXISTS "opportunity_customerId_fkey";
-- Add the foreign key constraint with ON DELETE SET NULL
ALTER TABLE "opportunity" ADD CONSTRAINT "opportunity_customerId_fkey"
FOREIGN KEY ("customerId") REFERENCES "customer" ("id") ON DELETE SET NULL ON UPDATE CASCADE;