Last active
October 26, 2019 09:23
-
-
Save Kcko/2b49c75f73594a80edc95dac158c9b7b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TRIGGER diskuse_ai AFTER INSERT ON diskuse FOR EACH ROW UPDATE clanky SET diskuse_pocet = diskuse_pocet + 1 WHERE id = NEW.clanek; | |
CREATE TRIGGER diskuse_ad AFTER DELETE ON diskuse FOR EACH ROW UPDATE clanky SET diskuse_pocet = diskuse_pocet - 1 WHERE id = OLD.clanek; | |
CREATE TRIGGER diskuse_au AFTER UPDATE ON diskuse FOR EACH ROW UPDATE clanky SET diskuse_pocet = diskuse_pocet + IF(id = NEW.clanek, 1, -1) WHERE id = OLD.clanek XOR id = NEW.clanek; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- https://diskuse.jakpsatweb.cz/?action=vthread&forum=28&topic=172769#7 | |
IF NEW.id = 10 | |
THEN | |
UPDATE mantis_custom_field_table | |
SET possible_values = NEW.possible_values | |
WHERE id = 11 | |
AND NOT possible_values <=> NEW.possible_values; | |
END IF; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment