oms-Billing/Admin/Install/db.mysql.sql
Dennis Eichhorn 0722a5dea0
Some checks failed
Image optimization / general_image_workflow (push) Has been cancelled
CI / general_module_workflow_php (push) Has been cancelled
CI / general_module_workflow_js (push) Has been cancelled
fix permissions
2025-04-02 14:15:04 +00:00

11 lines
357 B
SQL

CREATE TRIGGER update_billing_bill_sequence
BEFORE INSERT ON billing_bill
FOR EACH ROW BEGIN
SET NEW.billing_bill_sequence = (
SELECT COALESCE(MAX(billing_bill_sequence), 0) + 1
FROM billing_bill
WHERE billing_bill_unit = NEW.billing_bill_unit
AND billing_bill_type = NEW.billing_bill_type
LIMIT 1
);
END;