1 升级记录
Xu Chang edited this page 2024-09-11 15:18:53 +08:00
This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[v5.1.0]:

  • 增加了Log对象修改了Oper对象的结构以支持未来的Undo
  • 修改了编译器和UpdateSingleRow的逻辑以支持Log能力
  • UpdateAttrMatrix中的filter增加了回调函数式接口

升级脚本

CREATE TABLE `log` (
 `entity` varchar(32) NOT NULL,
 `entityId` varchar(64) NOT NULL,
 `iState` enum('normal','rollbacked') DEFAULT NULL,
 `id` char(36) NOT NULL,
 `$$seq$$` bigint NOT NULL AUTO_INCREMENT,
 `$$createAt$$` bigint NOT NULL,
 `$$updateAt$$` bigint NOT NULL,
 `$$deleteAt$$` bigint DEFAULT NULL,
 `$$triggerData$$` json DEFAULT NULL,
 `$$triggerUuid$$` char(36) DEFAULT NULL,
 PRIMARY KEY (`id`),
 UNIQUE KEY `$$seq$$` (`$$seq$$`),
 KEY `log_create_at_auto_create` (`$$createAt$$`,`$$deleteAt$$`),
 KEY `log_update_at_auto_create` (`$$updateAt$$`,`$$deleteAt$$`),
 KEY `log_trigger_uuid` (`$$triggerUuid$$`,`$$deleteAt$$`),
 KEY `log_fk_entity_entityId_auto_create` (`entity`,`entityId`,`$$deleteAt$$`)
) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

Alter table `oper` add column `logId` char(36) DEFAULT NULL;
Alter table `oper` add column `iState` enum('normal','rollbacked') DEFAULT NULL;
Alter table `oper` add column `undoData` json DEFAULT NULL;
create index `oper_fk_logId_auto_create` on oper(logId, $$deleteAt$$);