2024-01-15 11:31:03 +00:00
|
|
|
DELIMITER $$
|
2024-01-25 16:33:54 +00:00
|
|
|
CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `srt`.`moving_afterInsert`
|
2024-01-15 11:31:03 +00:00
|
|
|
AFTER INSERT ON `moving`
|
|
|
|
FOR EACH ROW
|
|
|
|
BEGIN
|
|
|
|
|
|
|
|
INSERT INTO srt.movingLog(movingFk, expeditionFk, bufferFromFk, bufferToFk, stateFk, isColliding, `action`)
|
|
|
|
VALUES(NEW.id, NEW.expeditionFk, NEW.bufferFromFk, NEW.bufferToFk, NEW.stateFk, NEW.isColliding, 'NEW2');
|
|
|
|
|
|
|
|
DELETE FROM srt.movingLast;
|
|
|
|
|
|
|
|
INSERT INTO srt.movingLast (id, expeditionFk, bufferFromFk, bufferToFk)
|
|
|
|
VALUES(NEW.id, NEW.expeditionFk, NEW.bufferFromFk, NEW.bufferToFk);
|
|
|
|
|
|
|
|
IF srt.buffer_isFull(NEW.bufferToFk) THEN
|
|
|
|
|
|
|
|
CALL srt.buffer_setStateType(NEW.bufferToFk, 'FULL',NULL);
|
|
|
|
|
|
|
|
END IF;
|
|
|
|
|
|
|
|
END$$
|
|
|
|
DELIMITER ;
|