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 back delete

Sidwebworks8876fa50e883
diff --git a/packages/database/supabase/functions/sync/index.ts b/packages/database/supabase/functions/sync/index.ts
index 1c7f37678c..5be2a1898e 100644
--- a/packages/database/supabase/functions/sync/index.ts
+++ b/packages/database/supabase/functions/sync/index.ts
@@ -419,6 +419,13 @@ serve(async (req: Request) => {
.where("id", "=", itemId)
.execute();
+ await trx
+ .deleteFrom("externalIntegrationMapping")
+ .where("entityType", "=", "item")
+ .where("entityId", "=", itemId)
+ .where("integration", "=", "onshapeData")
+ .execute();
+
await trx
.insertInto("externalIntegrationMapping")
.values({