Last active
May 31, 2026 20:10
-
-
Save thinkphp/1724403e5a3649186f73a947040d8182 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| -- Daca Team ori Player este inregistrat in Diqualifications table, trebuie o formula automata / trigger sa activeze in entitatea corecta (Team ori Player, dupa caz), in atributul Player_Registration_Status / Team_Registration_Status optiunea ‘Disqualified’ | |
| DELIMITER $$ | |
| CREATE TRIGGER trg_player_disqualification | |
| AFTER INSERT ON Disqualifications | |
| FOR EACH ROW | |
| BEGIN | |
| IF NEW.Player_ID IS NOT NULL THEN | |
| UPDATE Player | |
| SET Player_Registration_Status = 'Disqualified' | |
| WHERE Player_ID = NEW.Player_ID; | |
| END IF; | |
| END $$ | |
| DELIMITER ; | |
| DELIMITER $$ | |
| CREATE TRIGGER trg_team_disqualification | |
| AFTER INSERT ON Disqualifications | |
| FOR EACH ROW | |
| BEGIN | |
| -- Daca disqualificarea e pentru echipa | |
| IF NEW.Team_ID IS NOT NULL THEN | |
| UPDATE Team | |
| SET Team_Registration_Status = 'Disqualified' | |
| WHERE Team_ID = NEW.Team_ID; | |
| END IF; | |
| END $$ | |
| DELIMITER ; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment