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: drop materials view before redefining it

Brad Barbin3ed79fa3baf5
diff --git a/packages/database/supabase/migrations/20251122152701_materials-view-fix.sql b/packages/database/supabase/migrations/20251122152701_materials-view-fix.sql
index 14072d49fa..9125fedc69 100644
--- a/packages/database/supabase/migrations/20251122152701_materials-view-fix.sql
+++ b/packages/database/supabase/migrations/20251122152701_materials-view-fix.sql
@@ -1,3 +1,4 @@
+DROP VIEW IF EXISTS "materials";
CREATE OR REPLACE VIEW "materials" WITH (SECURITY_INVOKER=true) AS
WITH latest_items AS (
SELECT DISTINCT ON (i."readableId", i."companyId")