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.

409 B
Raw Blame
CREATE OR REPLACE FUNCTION public.sync_edit_document_transaction(p_table text, p_operation text, p_new jsonb, p_old jsonb)
 RETURNS void
 LANGUAGE plpgsql
 SET search_path TO 'public', 'extensions'
AS $function$
BEGIN
  IF p_operation != 'UPDATE' THEN RETURN; END IF;

  INSERT INTO "documentTransaction" ("documentId", "type", "userId")
  VALUES (p_new->>'id', 'Edit', p_new->>'createdBy');
END;
$function$;