Skip to content

Commit

Permalink
Use new syntax to replace procedure and trigger #10799
Browse files Browse the repository at this point in the history
  • Loading branch information
PowerKiKi committed Oct 15, 2024
1 parent cb7ff3b commit eb5101d
Showing 1 changed file with 5 additions and 16 deletions.
21 changes: 5 additions & 16 deletions data/triggers.sql
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,8 @@

DELIMITER ~~


DROP PROCEDURE IF EXISTS update_account_balance;

/* Update balance from a single account (account_id > 0) or ALL accounts (account_id = 0) */
CREATE PROCEDURE update_account_balance (IN account_id INT)
CREATE OR REPLACE PROCEDURE update_account_balance (IN account_id INT)
BEGIN
-- Update non-group accounts from their transactions
DECLARE debit INT;
Expand Down Expand Up @@ -77,9 +74,7 @@ BEGIN
END ~~


DROP TRIGGER IF EXISTS transaction_DELETE;

CREATE TRIGGER transaction_DELETE
CREATE OR REPLACE TRIGGER transaction_DELETE
BEFORE DELETE
ON transaction
FOR EACH ROW
Expand All @@ -91,9 +86,7 @@ BEGIN
END; ~~


DROP TRIGGER IF EXISTS transaction_line_INSERT;

CREATE TRIGGER transaction_line_INSERT
CREATE OR REPLACE TRIGGER transaction_line_INSERT
AFTER INSERT
ON transaction_line
FOR EACH ROW
Expand All @@ -115,9 +108,7 @@ CREATE TRIGGER transaction_line_INSERT
END; ~~


DROP TRIGGER IF EXISTS transaction_line_DELETE;

CREATE TRIGGER transaction_line_DELETE
CREATE OR REPLACE TRIGGER transaction_line_DELETE
AFTER DELETE
ON transaction_line
FOR EACH ROW
Expand All @@ -141,9 +132,7 @@ CREATE TRIGGER transaction_line_DELETE
END; ~~


DROP TRIGGER IF EXISTS transaction_line_UPDATE;

CREATE TRIGGER transaction_line_UPDATE
CREATE OR REPLACE TRIGGER transaction_line_UPDATE
AFTER UPDATE
ON transaction_line
FOR EACH ROW
Expand Down

0 comments on commit eb5101d

Please sign in to comment.