Novos valores podem ser acessados por
NEW.
, antigo por OLD.
. Você pode compará-los para definir se os valores foram alterados. CREATE TRIGGER insert_template BEFORE INSERT ON template
FOR EACH ROW BEGIN
SET NEW.gen_date := now();
IF NEW.image <> '' THEN
SET NEW.image_date := now();
END IF;
END;
CREATE TRIGGER update_template BEFORE UPDATE ON template
FOR EACH ROW BEGIN
IF NEW.image <> OLD.image THEN
SET NEW.image_date := now();
END IF;
END;