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.

Add webhook support for salesInvoice table (#534)

Brad Barbinf87d22e274fb
diff --git a/packages/database/supabase/migrations/20260219000000_add-salesInvoice-webhooks.sql b/packages/database/supabase/migrations/20260219000000_add-salesInvoice-webhooks.sql
new file mode 100644
index 0000000000..63fc7be7ec
--- /dev/null
+++ b/packages/database/supabase/migrations/20260219000000_add-salesInvoice-webhooks.sql
@@ -0,0 +1,16 @@
+-- Add webhook support for salesInvoice table
+
+INSERT INTO "webhookTable" ("table", "module", "name") VALUES
+('salesInvoice', 'Invoicing', 'Sales Invoice');
+
+CREATE OR REPLACE TRIGGER "salesInvoiceInsertWebhook"
+AFTER INSERT ON "salesInvoice"
+FOR EACH ROW EXECUTE FUNCTION public.webhook_insert();
+
+CREATE OR REPLACE TRIGGER "salesInvoiceUpdateWebhook"
+AFTER UPDATE ON "salesInvoice"
+FOR EACH ROW EXECUTE FUNCTION public.webhook_update();
+
+CREATE OR REPLACE TRIGGER "salesInvoiceDeleteWebhook"
+AFTER DELETE ON "salesInvoice"
+FOR EACH ROW EXECUTE FUNCTION public.webhook_delete();