MySQL
- 5 ответов
- 0 вопросов
3
Вклад в тег
DELIMITER $$
CREATE TRIGGER `towork` BEFORE UPDATE
ON `modx_lfvideo_items`
FOR EACH ROW
BEGIN
IF (NEW.status <> OLD.status) THEN
CASE NEW.status
WHEN 1 THEN SET NEW.towork = CURRENT_TIMESTAMP();
WHEN 2 THEN SET NEW.finished = CURRENT_TIMESTAMP();
END CASE;
END IF;
END$$
DELIMITER ;