CREATE TABLE `aowow_sync` (
`table` VARCHAR(50) NOT NULL,
`entry` INT NOT NULL,
`action` TINYINT NOT NULL COMMENT '0:delete; 1:insert; 2:update'
) COLLATE='utf8_general_ci' ENGINE=MyISAM;
delimiter |
CREATE TRIGGER aowow_sync_
_delete BEFORE DELETE ON
FOR EACH ROW
BEGIN
REPLACE INTO aowow_sync (`table`, `entry`, `action`) VALUES ('', OLD.entry, 0);
END;
|
CREATE TRIGGER aowow_sync__insert AFTER INSERT ON
FOR EACH ROW
BEGIN
REPLACE INTO aowow_sync (`table`, `entry`, `action`) VALUES ('', NEW.entry, 1);
END;
|
CREATE TRIGGER aowow_sync__update AFTER UPDATE ON
FOR EACH ROW
BEGIN
REPLACE INTO aowow_sync (`table`, `entry`, `action`) VALUES ('', NEW.entry, 2);
END;
|
delimiter ;