Commit 5a8332f6 authored by nextime's avatar nextime

triggers are in the primary sql file.

parent b66b5400
DELIMITER $$
CREATE TRIGGER relstatus_lastchange BEFORE UPDATE ON relstatus
FOR EACH ROW
BEGIN
IF NEW.status <> OLD.status OR NEW.ampere <> OLD.ampere THEN
SET NEW.lastchange = NEW.lastupdate;
END IF;
END$$
CREATE TRIGGER inpstatus_lastchange BEFORE UPDATE ON inpstatus
FOR EACH ROW
BEGIN
IF NEW.status <> OLD.status THEN
SET NEW.lastchange = NEW.lastupdate;
END IF;
END$$
CREATE TRIGGER anastatus_lastchange BEFORE UPDATE ON anastatus
FOR EACH ROW
BEGIN
IF NEW.status <> OLD.status THEN
SET NEW.lastchange = NEW.lastupdate;
END IF;
END$$
CREATE TRIGGER actstatus_lastchange BEFORE UPDATE ON actstatus
FOR EACH ROW
BEGIN
IF NEW.status <> OLD.status OR NEW.status2 <> OLD.status2 THEN
SET NEW.lastchange = NEW.lastupdate;
END IF;
END$$
DELIMITER ;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment