- 字段設(shè)計(jì)
`createAt` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '創(chuàng)建時(shí)間自動(dòng)添加',
`updateAt` TIMESTAMP NOT NULL COMMENT '最后一次更新時(shí)間界逛,自動(dòng)添加',
- 觸發(fā)器
createTrigger:"DROP TRIGGER IF EXISTS `update_users_trigger`;\
CREATE TRIGGER update_users_trigger BEFORE UPDATE ON users \
FOR EACH ROW SET NEW.updateAt = NOW();",