微信扫一扫分享精彩
|
- DELIMITER $$
-
- CREATE TRIGGER `触发器名称` AFTER INSERT ON `原表名`
- FOR EACH ROW
- BEGIN
- INSERT INTO `audit_log` (
- `table_name`, `record_id`, `action_type`, `timestamp`
- ) VALUES (
- 'orders', NEW.id, 'INSERT', NOW()
- );
- END$$
-
- DELIMITER ;
https://blog.51cto.com/u_16213343/8713389
|