mariadb
-
마리아디비, MySQL 트리거를 통한 테이블 히스토리 쌓기개발 2022. 1. 10. 11:34
CREATE DEFINER=`root`@`127.0.0.1` TRIGGER `table_after_update` AFTER UPDATE ON `table` FOR EACH ROW BEGIN INSERT INTO table_history ( table_idx, table_name, table1, table2, table3, table4, table5, table6, insert_dt ) VALUES ( CONCAT(OLD.table_idx, " -> ", NEW.table_idx), CONCAT(OLD.table_name, " -> ", NEW.table_name), CONCAT(OLD.table1, " -> ", NEW.table1), CONCAT(OLD.table2, " -> ", NEW.table2)..