2 Star 9 Fork 2

DataFlux/dataflux-func

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
upgrade-info.yaml 88.79 KB
一键复制 编辑 原始数据 按行查看 历史
Pastgift 提交于 2024-11-20 20:52 . 调整 upgrade-info
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443
# 当前数据库版本SEQ保存于`wat_main_system_config`,ID为`UPGRADE_DB_SEQ`
# 全新安装会自动创建此数据,参考SQL如下:
# INSERT INTO wat_main_system_config SET `id` = 'UPGRADE_DB_SEQ', `value` = '13'
upgradeInfo:
- seq: 0
database: |-
SELECT 'Base DB';
- seq: 1
database: |-
-- 新增文件服务功能
CREATE TABLE `biz_main_file_service` (
`seq` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
`root` text DEFAULT NULL COMMENT '根目录',
`isDisabled` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否禁用',
`note` text COMMENT '备注',
`createTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updateTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`seq`),
UNIQUE KEY `ID` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='文件服务';
- seq: 2
database: |-
-- 添加授权链接标签功能
ALTER TABLE `biz_main_auth_link`
ADD COLUMN `tagsJSON` json DEFAULT NULL COMMENT '授权链接标签JSON'
AFTER `funcCallKwargsJSON`;
-- KwargsJSON字段改为TEXT,保证入库出库时JSON字段顺序一致性
ALTER TABLE biz_main_func
MODIFY COLUMN `kwargsJSON` TEXT DEFAULT NULL COMMENT '命名参数JSON';
ALTER TABLE biz_main_auth_link
MODIFY COLUMN `funcCallKwargsJSON` TEXT NOT NULL COMMENT '函数调用参数JSON (kwargs)';
ALTER TABLE biz_main_crontab_config
MODIFY COLUMN `funcCallKwargsJSON` TEXT NOT NULL COMMENT '函数调用参数JSON (kwargs)';
ALTER TABLE biz_main_batch
MODIFY COLUMN `funcCallKwargsJSON` TEXT NOT NULL COMMENT '函数调用参数JSON (kwargs)';
- seq: 3
database: |-
-- 操作记录增加客户端IP
ALTER TABLE `biz_main_operation_record`
ADD COLUMN `clientIPsJSON` json DEFAULT NULL COMMENT '客户端IP JSON'
AFTER `clientId`;
- seq: 4
database: |-
-- 脚本集增加依赖包信息
ALTER TABLE `biz_main_script_set`
ADD COLUMN `requirements` text DEFAULT NULL COMMENT '依赖包'
AFTER `description`;
- seq: 5
database: |-
-- 调整脚本库还原点处理方式
ALTER TABLE `biz_main_script_recover_point`
MODIFY COLUMN `tableDumpJSON` json DEFAULT NULL COMMENT '表备份数据JSON';
ALTER TABLE `biz_main_script_recover_point`
ADD COLUMN `exportData` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT '脚本库导出数据'
AFTER `tableDumpJSON`;
- seq: 6
database: |-
-- 添加API认证功能
CREATE TABLE `biz_main_api_auth` (
`seq` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
`name` varchar(256) DEFAULT NULL COMMENT '名称',
`type` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '类型 fixedField|httpBasic|httpDigest|func',
`configJSON` json NOT NULL COMMENT '配置JSON',
`note` text COMMENT '备注',
`createTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updateTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`seq`),
UNIQUE KEY `ID` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='API认证';
-- 授权链接添加API认证支持
ALTER TABLE `biz_main_auth_link`
ADD COLUMN `apiAuthId` VARCHAR(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'API认证ID'
AFTER `tagsJSON`;
-- 批处理添加API认证支持
ALTER TABLE `biz_main_batch`
ADD COLUMN `apiAuthId` VARCHAR(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'API认证ID'
AFTER `tagsJSON`;
- seq: 7
database: |-
-- 添加蓝图功能
CREATE TABLE `biz_main_blueprint` (
`seq` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
`title` varchar(256) DEFAULT NULL COMMENT '标题',
`canvasJSON` json NOT NULL COMMENT '画布JSON',
`isDeployed` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否已部署',
`createTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updateTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`seq`),
UNIQUE KEY `ID` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='蓝图';
- seq: 8
database: |-
-- 脚本集/数据源/环境变量增加置顶功能
ALTER TABLE biz_main_script_set
ADD COLUMN `pinTime` DATETIME DEFAULT NULL COMMENT '置顶时间'
AFTER `lockedByUserId`;
ALTER TABLE biz_main_data_source
ADD COLUMN `pinTime` DATETIME DEFAULT NULL COMMENT '置顶时间'
AFTER `isBuiltin`;
ALTER TABLE biz_main_env_variable
ADD COLUMN `pinTime` DATETIME DEFAULT NULL COMMENT '置顶时间'
AFTER `autoTypeCasting`;
-- 自动触发任务增加层级归类
TRUNCATE biz_main_crontab_task_info;
ALTER TABLE biz_main_crontab_task_info
ADD COLUMN `rootTaskId` VARCHAR(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT 'ROOT' COMMENT '主任务ID'
AFTER `crontabConfigId`;
ALTER TABLE biz_main_crontab_task_info
ADD INDEX `ROOT_TASK_ID` (rootTaskId);
TRUNCATE biz_main_batch_task_info;
ALTER TABLE biz_main_batch_task_info
ADD COLUMN `rootTaskId` VARCHAR(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT 'ROOT' COMMENT '主任务ID'
AFTER `batchId`;
ALTER TABLE biz_main_batch_task_info
ADD INDEX `ROOT_TASK_ID` (rootTaskId);
# 于观测云 SaaS 2022-01-20 迭代中实装
- seq: 9
database: |-
-- 自动触发配置/批处理支持配置任务记录数量
ALTER TABLE biz_main_crontab_config
ADD COLUMN `taskInfoLimit` INT(11) DEFAULT NULL COMMENT '任务记录数量'
AFTER `origin`;
ALTER TABLE biz_main_batch
ADD COLUMN `taskInfoLimit` INT(11) DEFAULT NULL COMMENT '任务记录数量'
AFTER `showInDoc`;
# 于观测云 SaaS 2022-02-22 迭代中实装
- seq: 10
database: |-
-- 优化任务记录功能
CREATE TABLE `biz_main_task_info` (
`seq` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
`originId` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '任务来源ID',
`rootTaskId` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT 'ROOT' COMMENT '主任务ID',
`funcId` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '函数ID',
`execMode` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '执行模式 sync|async|crontab',
`status` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '状态 success|failure',
`triggerTimeMs` bigint(20) unsigned NOT NULL,
`startTimeMs` bigint(20) unsigned NOT NULL,
`endTimeMs` bigint(20) unsigned NOT NULL,
`logMessageTEXT` longtext COMMENT '日志信息TEXT',
`einfoTEXT` longtext COMMENT '错误信息TEXT',
`edumpTEXT` longtext COMMENT '错误DUMPTEXT',
`createTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updateTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`seq`),
UNIQUE KEY `ID` (`id`),
KEY `ORIGIN_ID` (`originId`),
KEY `ROOT_TASK_ID` (`rootTaskId`),
KEY `FUNC_ID` (`funcId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='任务信息'
# 于观测云 SaaS 2022-05-19 迭代中实装
- seq: 11
database: |-
-- 授权链接支持配置任务记录数量
ALTER TABLE biz_main_auth_link
ADD COLUMN `taskInfoLimit` INT(11) DEFAULT NULL COMMENT '任务记录数量'
AFTER `showInDoc`;
# 于观测云 SaaS 2022-09-01 迭代中实装
- seq: 12
database: |-
-- 「数据源」重命名为「连接器」
RENAME TABLE biz_main_data_source TO biz_main_connector;
# 于观测云 SaaS 2022-09-29 迭代中实装
- seq: 13
database: |-
-- 扩充系统配置 value 字段
ALTER TABLE wat_main_system_config
MODIFY COLUMN `value` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '值';
# 于观测云 SaaS 2022-12-29 迭代中实装
- seq: 14
database: |-
-- 旧版遗漏
ALTER TABLE biz_main_connector
COMMENT = '连接器';
ALTER TABLE biz_main_connector
MODIFY COLUMN `isBuiltin` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否为内建连接器';
-- DataFlux Func 2.x
DROP TABLE IF EXISTS `biz_main_script_market`;
CREATE TABLE `biz_main_script_market` (
`seq` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '脚本市场ID',
`name` varchar(256) DEFAULT NULL COMMENT '名称',
`description` text COMMENT '描述',
`type` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '类型 git|aliyunOSS|httpService',
`configJSON` json DEFAULT NULL COMMENT '配置信息JSON',
`pinTime` datetime DEFAULT NULL COMMENT '置顶时间',
`createTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updateTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`seq`),
UNIQUE KEY `ID` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='脚本市场';
-- 用户支持配置邮箱
ALTER TABLE wat_main_user
ADD COLUMN `email` varchar(256) DEFAULT NULL COMMENT '邮箱' AFTER `name`;
-- 修改JSON字段类型为 json
ALTER TABLE biz_main_func
MODIFY COLUMN `kwargsJSON` json DEFAULT NULL COMMENT '命名参数JSON';
ALTER TABLE biz_main_auth_link
MODIFY COLUMN `funcCallKwargsJSON` json DEFAULT NULL COMMENT '函数调用参数JSON (kwargs)';
ALTER TABLE biz_main_crontab_config
MODIFY COLUMN `funcCallKwargsJSON` json DEFAULT NULL COMMENT '函数调用参数JSON (kwargs)';
ALTER TABLE biz_main_batch
MODIFY COLUMN `funcCallKwargsJSON` json DEFAULT NULL COMMENT '函数调用参数JSON (kwargs)';
ALTER TABLE wat_main_task_result_example
MODIFY COLUMN `argsJSON` json DEFAULT NULL,
MODIFY COLUMN `kwargsJSON` json DEFAULT NULL,
MODIFY COLUMN `retvalJSON` json DEFAULT NULL;
-- 调整脚本 MD5
ALTER TABLE biz_main_script
MODIFY COLUMN `codeMD5` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '代码MD5',
MODIFY COLUMN `codeDraftMD5` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '代码(编辑中草稿)MD5';
-- 调整 origin, originId 处理
ALTER TABLE biz_main_task_info
MODIFY COLUMN `originId` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT 'UNKNOW' COMMENT '任务来源ID';
ALTER TABLE biz_main_script_set
ADD COLUMN `origin` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT 'UNKNOW' COMMENT '来源' AFTER `requirements`;
ALTER TABLE biz_main_script_set
ADD COLUMN `originId` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT 'UNKNOW' COMMENT '来源ID' AFTER `origin`;
ALTER TABLE biz_main_script_set
ADD KEY `ORIGIN_ID` (`originId`);
ALTER TABLE biz_main_auth_link
MODIFY COLUMN `origin` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT 'UNKNOW' COMMENT '来源';
ALTER TABLE biz_main_crontab_config
MODIFY COLUMN `origin` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT 'UNKNOW' COMMENT '来源';
ALTER TABLE biz_main_batch
MODIFY COLUMN `origin` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT 'UNKNOW' COMMENT '来源';
ALTER TABLE biz_main_auth_link
ADD COLUMN `originId` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT 'UNKNOW' COMMENT '来源ID' AFTER `origin`;
ALTER TABLE biz_main_crontab_config
ADD COLUMN `originId` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT 'UNKNOW' COMMENT '来源ID' AFTER `origin`;
ALTER TABLE biz_main_batch
ADD COLUMN `originId` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT 'UNKNOW' COMMENT '来源ID' AFTER `origin`;
ALTER TABLE biz_main_auth_link
ADD KEY `ORIGIN_ID` (`originId`);
ALTER TABLE biz_main_crontab_config
ADD KEY `ORIGIN_ID` (`originId`);
ALTER TABLE biz_main_batch
ADD KEY `ORIGIN_ID` (`originId`);
UPDATE biz_main_auth_link SET origin = 'user' WHERE origin = 'UI';
UPDATE biz_main_auth_link SET origin = 'UNKNOW' WHERE origin = 'API';
UPDATE biz_main_crontab_config SET origin = 'user' WHERE origin = 'UI';
UPDATE biz_main_crontab_config SET origin = 'UNKNOW' WHERE origin = 'API';
UPDATE biz_main_batch SET origin = 'user' WHERE origin = 'UI';
UPDATE biz_main_batch SET origin = 'UNKNOW' WHERE origin = 'API';
# 于观测云 SaaS 2022-12-29 迭代中实装
- seq: 15
database: |-
-- 脚本集增加和导入、安装时对比
ALTER TABLE biz_main_script_set
ADD COLUMN `originMD5` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '来源MD5'
AFTER `originId`;
# 于观测云 SaaS 2022-12-29 迭代中实装
- seq: 16
database: |-
-- 脚本市场加入锁定功能
ALTER TABLE biz_main_script_market
ADD COLUMN `lockedByUserId` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '锁定者用户ID'
AFTER `configJSON`;
# 于观测云 SaaS 2023-04-20 迭代中实装
- seq: 17
database: |-
-- 添加脚本市场额外配置
ALTER TABLE `biz_main_script_market`
ADD COLUMN `extraJSON` json DEFAULT NULL COMMENT '额外信息JSON'
AFTER `configJSON`;
# 于观测云 SaaS 2023-04-27 迭代中实装
- seq: 18
database: |-
-- 清理任务记录
TRUNCATE biz_main_task_info;
-- 修复以往拼写错误
ALTER TABLE `biz_main_auth_link`
MODIFY COLUMN `origin` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT 'UNKNOWN' COMMENT '来源',
MODIFY COLUMN `originId` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT 'UNKNOWN' COMMENT '来源ID';
ALTER TABLE `biz_main_crontab_config`
MODIFY COLUMN `origin` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT 'UNKNOWN' COMMENT '来源',
MODIFY COLUMN `originId` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT 'UNKNOWN' COMMENT '来源ID';
ALTER TABLE `biz_main_batch`
MODIFY COLUMN `origin` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT 'UNKNOWN' COMMENT '来源',
MODIFY COLUMN `originId` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT 'UNKNOWN' COMMENT '来源ID';
ALTER TABLE `biz_main_script_set`
MODIFY COLUMN `origin` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT 'UNKNOWN' COMMENT '来源',
MODIFY COLUMN `originId` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT 'UNKNOWN' COMMENT '来源ID';
ALTER TABLE `biz_main_task_info`
MODIFY COLUMN `originId` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT 'UNKNOWN' COMMENT '任务来源ID';
-- 任务记录添加来源
ALTER TABLE `biz_main_task_info`
ADD COLUMN `origin` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT 'UNKNOW' COMMENT '任务来源'
AFTER `id`;
-- 修复拼写错误
UPDATE `biz_main_auth_link` SET `origin` = 'UNKNOWN' WHERE `origin` = 'UNKNOW';
UPDATE `biz_main_crontab_config` SET `origin` = 'UNKNOWN' WHERE `origin` = 'UNKNOW';
UPDATE `biz_main_batch` SET `origin` = 'UNKNOWN' WHERE `origin` = 'UNKNOW';
UPDATE `biz_main_script_set` SET `origin` = 'UNKNOWN' WHERE `origin` = 'UNKNOW';
UPDATE `biz_main_auth_link` SET `originId` = 'UNKNOWN' WHERE `originId` = 'UNKNOW';
UPDATE `biz_main_crontab_config` SET `originId` = 'UNKNOWN' WHERE `originId` = 'UNKNOW';
UPDATE `biz_main_batch` SET `originId` = 'UNKNOWN' WHERE `originId` = 'UNKNOW';
UPDATE `biz_main_script_set` SET `originId` = 'UNKNOWN' WHERE `originId` = 'UNKNOW';
# 于观测云 SaaS 2023-04-27 迭代中实装
- seq: 19
database: |-
-- 修复以往注释错误
ALTER TABLE `biz_main_auth_link`
MODIFY COLUMN `throttlingJSON` json DEFAULT NULL COMMENT '限流JSON';
# 于观测云 SaaS 2023-04-27 迭代中实装
- seq: 20
database: |-
-- 清理任务记录
TRUNCATE biz_main_task_info;
-- 任务记录表重建索引
ALTER TABLE biz_main_task_info
DROP INDEX `ORIGIN_ID`,
DROP INDEX `ROOT_TASK_ID`,
DROP INDEX `FUNC_ID`;
ALTER TABLE biz_main_task_info
ADD INDEX `ORIGIN` (`origin`),
ADD INDEX `ORIGIN_ID` (`originId`),
ADD INDEX `ROOT_TASK_ID` (`rootTaskId`),
ADD INDEX `FUNC_ID` (`funcId`);
-- 修复注释错误
ALTER TABLE `biz_main_task_info`
MODIFY COLUMN `origin` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT 'UNKNOWN' COMMENT '任务来源',
MODIFY COLUMN `originId` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT 'UNKNOWN' COMMENT '任务来源ID';
# 于观测云 SaaS 2023-06-20 迭代中实装
- seq: 21
database: |-
-- 系统设置表更名
RENAME TABLE `wat_main_system_config` TO `wat_main_system_setting`;
# 于观测云 SaaS 2023-07-11 迭代中实装
- seq: 22
database: |-
-- 删除无用的全文搜索索引
ALTER TABLE `biz_main_script` DROP INDEX `FT`;
ALTER TABLE `biz_main_script_publish_history` DROP INDEX `FT`;
# 于观测云 SaaS 2023-08-10 迭代中实装
- seq: 23
database: |-
-- 统一业务实体标题字段名
ALTER TABLE `biz_main_api_auth`
CHANGE `name` `title` varchar(256) DEFAULT NULL COMMENT '标题';
ALTER TABLE `biz_main_script_market`
CHANGE `name` `title` varchar(256) DEFAULT NULL COMMENT '标题';
ALTER TABLE `wat_main_access_key`
CHANGE `name` `title` varchar(256) NOT NULL;
-- 重建蓝图
DROP TABLE `biz_main_blueprint`;
CREATE TABLE `biz_main_blueprint` (
`seq` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
`title` varchar(256) DEFAULT NULL COMMENT '标题',
`description` text COMMENT '描述',
`canvasJSON` json NOT NULL COMMENT '画布JSON',
`viewJSON` json NOT NULL COMMENT '视图JSON',
`createTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updateTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`seq`),
UNIQUE KEY `ID` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='蓝图';
# 于观测云 SaaS 2023-09-07 迭代中实装
- seq: 24
database: |-
-- 清理过时表
TRUNCATE biz_main_task_info;
TRUNCATE biz_rel_func_running_info;
-- 更换任务记录配置字段
ALTER TABLE `biz_main_auth_link`
CHANGE `taskInfoLimit` `taskRecordLimit` int(11) DEFAULT NULL COMMENT '任务记录数量';
ALTER TABLE `biz_main_batch`
CHANGE `taskInfoLimit` `taskRecordLimit` int(11) DEFAULT NULL COMMENT '任务记录数量';
ALTER TABLE `biz_main_crontab_config`
CHANGE `taskInfoLimit` `taskRecordLimit` int(11) DEFAULT NULL COMMENT '任务记录数量';
-- 删除多余字段
ALTER TABLE `biz_main_crontab_config`
DROP COLUMN `saveResult`;
-- 自动触发支持指定时区
ALTER TABLE `biz_main_crontab_config`
ADD COLUMN `timezone` varchar(256) DEFAULT NULL COMMENT '时区' AFTER `crontab`;
-- 调整列顺序
ALTER TABLE biz_main_script_market
CHANGE `lockedByUserId` `lockedByUserId` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '锁定者用户ID'
AFTER `extraJSON`;
-- 重建任务记录表
CREATE TABLE `biz_main_task_record` (
`seq` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
`name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '任务名',
`kwargsJSON` json COMMENT '调用参数JSON',
`triggerTimeMs` bigint(20) unsigned NOT NULL COMMENT '触发时间(UNIX毫秒时间戳)',
`startTimeMs` bigint(20) unsigned NOT NULL COMMENT '启动时间(UNIX毫秒时间戳)',
`endTimeMs` bigint(20) unsigned NOT NULL COMMENT '结束时间(UNIX毫秒时间戳)',
`eta` text COMMENT 'ETA',
`delay` bigint(20) unsigned NOT NULL COMMENT '延迟时间',
`queue` bigint(20) unsigned NOT NULL COMMENT '执行队列',
`timeout` bigint(20) unsigned NOT NULL COMMENT '超时时间',
`expires` bigint(20) unsigned NOT NULL COMMENT '过期时间',
`ignoreResult` tinyint(1) NOT NULL COMMENT '是否忽略结果',
`resultJSON` json COMMENT '结果JSON',
`status` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '状态 success|failure|timeout|skip',
`exceptionType` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '错误类型',
`exceptionTEXT` longtext COMMENT '错误TEXT',
`tracebackTEXT` longtext COMMENT '调用堆栈TEXT',
`createTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updateTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`seq`),
UNIQUE KEY `ID` (`id`),
KEY `NAME` (`name`),
KEY `QUEUE` (`queue`),
KEY `STATUS` (`status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='任务记录';
CREATE TABLE `biz_main_task_record_func` (
`seq` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
`rootTaskId` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT 'ROOT' COMMENT '主任务ID',
`scriptSetId` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '脚本集ID',
`scriptId` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '脚本ID',
`funcId` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '函数ID',
`funcCallKwargsJSON` json COMMENT '调用参数JSON',
`origin` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT 'UNKNOWN' COMMENT '任务来源',
`originId` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT 'UNKNOWN' COMMENT '任务来源 ID',
`crontab` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '执行频率(Crontab语法)',
`callChainJSON` json COMMENT '函数调用链JSON',
`triggerTimeMs` bigint(20) unsigned NOT NULL COMMENT '触发时间(UNIX毫秒时间戳)',
`startTimeMs` bigint(20) unsigned NOT NULL COMMENT '启动时间(UNIX毫秒时间戳)',
`endTimeMs` bigint(20) unsigned NOT NULL COMMENT '结束时间(UNIX毫秒时间戳)',
`eta` text COMMENT 'ETA',
`delay` bigint(20) unsigned NOT NULL COMMENT '延迟时间',
`queue` bigint(20) unsigned NOT NULL COMMENT '执行队列',
`timeout` bigint(20) unsigned NOT NULL COMMENT '超时时间',
`expires` bigint(20) unsigned NOT NULL COMMENT '过期时间',
`ignoreResult` tinyint(1) NOT NULL COMMENT '是否忽略结果',
`status` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '状态 success|failure',
`exceptionType` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '错误类型',
`exceptionTEXT` longtext COMMENT '错误TEXT',
`tracebackTEXT` longtext COMMENT '调用堆栈TEXT',
`printLogsTEXT` longtext COMMENT 'print日志TEXT',
`returnValueJSON` json COMMENT '返回值JSON',
`responseControlJSON` json COMMENT '响应控制JSON',
`createTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updateTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`seq`),
UNIQUE KEY `ID` (`id`),
KEY `ROOT_TASK_ID` (`rootTaskId`),
KEY `SCRIPT_TASK_ID` (`scriptSetId`),
KEY `SCRIPT_ID` (`scriptId`),
KEY `FUNC_ID` (`funcId`),
KEY `ORIGIN` (`origin`),
KEY `ORIGIN_ID` (`originId`),
KEY `QUEUE` (`queue`),
KEY `STATUS` (`status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='任务记录(函数)';
# 于观测云 SaaS 2023-11-09 迭代中实装
- seq: 25
database: |-
-- 重建任务记录表(为 triggerTimeMs 添加索引并作为排序条件)
DROP TABLE IF EXISTS `biz_main_task_record`;
DROP TABLE IF EXISTS `biz_main_task_record_func`;
CREATE TABLE `biz_main_task_record` (
`seq` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
`name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '任务名',
`kwargsJSON` json COMMENT '调用参数JSON',
`triggerTimeMs` bigint(20) unsigned NOT NULL COMMENT '触发时间(UNIX毫秒时间戳)',
`startTimeMs` bigint(20) unsigned NOT NULL COMMENT '启动时间(UNIX毫秒时间戳)',
`endTimeMs` bigint(20) unsigned NOT NULL COMMENT '结束时间(UNIX毫秒时间戳)',
`eta` text COMMENT 'ETA',
`delay` bigint(20) unsigned NOT NULL COMMENT '延迟时间',
`queue` bigint(20) unsigned NOT NULL COMMENT '执行队列',
`timeout` bigint(20) unsigned NOT NULL COMMENT '超时时间',
`expires` bigint(20) unsigned NOT NULL COMMENT '过期时间',
`ignoreResult` tinyint(1) NOT NULL COMMENT '是否忽略结果',
`resultJSON` json COMMENT '结果JSON',
`status` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '状态 success|failure|timeout|skip',
`exceptionType` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '错误类型',
`exceptionTEXT` longtext COMMENT '错误TEXT',
`tracebackTEXT` longtext COMMENT '调用堆栈TEXT',
`createTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updateTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`seq`),
UNIQUE KEY `ID` (`id`),
KEY `NAME` (`name`),
KEY `TRIGGER_TIME_MS` (`triggerTimeMs`),
KEY `QUEUE` (`queue`),
KEY `STATUS` (`status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='任务记录';
CREATE TABLE `biz_main_task_record_func` (
`seq` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
`rootTaskId` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT 'ROOT' COMMENT '主任务ID',
`scriptSetId` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '脚本集ID',
`scriptId` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '脚本ID',
`funcId` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '函数ID',
`funcCallKwargsJSON` json COMMENT '调用参数JSON',
`origin` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT 'UNKNOWN' COMMENT '任务来源',
`originId` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT 'UNKNOWN' COMMENT '任务来源 ID',
`crontab` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '执行频率(Crontab语法)',
`callChainJSON` json COMMENT '函数调用链JSON',
`triggerTimeMs` bigint(20) unsigned NOT NULL COMMENT '触发时间(UNIX毫秒时间戳)',
`startTimeMs` bigint(20) unsigned NOT NULL COMMENT '启动时间(UNIX毫秒时间戳)',
`endTimeMs` bigint(20) unsigned NOT NULL COMMENT '结束时间(UNIX毫秒时间戳)',
`eta` text COMMENT 'ETA',
`delay` bigint(20) unsigned NOT NULL COMMENT '延迟时间',
`queue` bigint(20) unsigned NOT NULL COMMENT '执行队列',
`timeout` bigint(20) unsigned NOT NULL COMMENT '超时时间',
`expires` bigint(20) unsigned NOT NULL COMMENT '过期时间',
`ignoreResult` tinyint(1) NOT NULL COMMENT '是否忽略结果',
`status` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '状态 success|failure',
`exceptionType` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '错误类型',
`exceptionTEXT` longtext COMMENT '错误TEXT',
`tracebackTEXT` longtext COMMENT '调用堆栈TEXT',
`printLogsTEXT` longtext COMMENT 'print日志TEXT',
`returnValueJSON` json COMMENT '返回值JSON',
`responseControlJSON` json COMMENT '响应控制JSON',
`createTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updateTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`seq`),
UNIQUE KEY `ID` (`id`),
KEY `ROOT_TASK_ID` (`rootTaskId`),
KEY `SCRIPT_TASK_ID` (`scriptSetId`),
KEY `SCRIPT_ID` (`scriptId`),
KEY `FUNC_ID` (`funcId`),
KEY `ORIGIN` (`origin`),
KEY `ORIGIN_ID` (`originId`),
KEY `TRIGGER_TIME_MS` (`triggerTimeMs`),
KEY `QUEUE` (`queue`),
KEY `STATUS` (`status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='任务记录(函数)';
# 于观测云 SaaS 2023-11-16 迭代中实装
- seq: 26
database: |-
-- 重建任务记录表(triggerTimeMs 不适宜作为排序条件,删除)
DROP TABLE IF EXISTS `biz_main_task_record`;
DROP TABLE IF EXISTS `biz_main_task_record_func`;
CREATE TABLE `biz_main_task_record` (
`seq` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
`name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '任务名',
`kwargsJSON` json COMMENT '调用参数JSON',
`triggerTimeMs` bigint(20) unsigned NOT NULL COMMENT '触发时间(UNIX毫秒时间戳)',
`startTimeMs` bigint(20) unsigned NOT NULL COMMENT '启动时间(UNIX毫秒时间戳)',
`endTimeMs` bigint(20) unsigned NOT NULL COMMENT '结束时间(UNIX毫秒时间戳)',
`eta` text COMMENT 'ETA',
`delay` bigint(20) unsigned NOT NULL COMMENT '延迟时间',
`queue` bigint(20) unsigned NOT NULL COMMENT '执行队列',
`timeout` bigint(20) unsigned NOT NULL COMMENT '超时时间',
`expires` bigint(20) unsigned NOT NULL COMMENT '过期时间',
`ignoreResult` tinyint(1) NOT NULL COMMENT '是否忽略结果',
`resultJSON` json COMMENT '结果JSON',
`status` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '状态 success|failure|timeout|skip',
`exceptionType` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '错误类型',
`exceptionTEXT` longtext COMMENT '错误TEXT',
`tracebackTEXT` longtext COMMENT '调用堆栈TEXT',
`createTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updateTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`seq`),
UNIQUE KEY `ID` (`id`),
KEY `NAME` (`name`),
KEY `QUEUE` (`queue`),
KEY `STATUS` (`status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='任务记录';
CREATE TABLE `biz_main_task_record_func` (
`seq` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
`rootTaskId` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT 'ROOT' COMMENT '主任务ID',
`scriptSetId` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '脚本集ID',
`scriptId` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '脚本ID',
`funcId` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '函数ID',
`funcCallKwargsJSON` json COMMENT '调用参数JSON',
`origin` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT 'UNKNOWN' COMMENT '任务来源',
`originId` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT 'UNKNOWN' COMMENT '任务来源 ID',
`crontab` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '执行频率(Crontab语法)',
`callChainJSON` json COMMENT '函数调用链JSON',
`triggerTimeMs` bigint(20) unsigned NOT NULL COMMENT '触发时间(UNIX毫秒时间戳)',
`startTimeMs` bigint(20) unsigned NOT NULL COMMENT '启动时间(UNIX毫秒时间戳)',
`endTimeMs` bigint(20) unsigned NOT NULL COMMENT '结束时间(UNIX毫秒时间戳)',
`eta` text COMMENT 'ETA',
`delay` bigint(20) unsigned NOT NULL COMMENT '延迟时间',
`queue` bigint(20) unsigned NOT NULL COMMENT '执行队列',
`timeout` bigint(20) unsigned NOT NULL COMMENT '超时时间',
`expires` bigint(20) unsigned NOT NULL COMMENT '过期时间',
`ignoreResult` tinyint(1) NOT NULL COMMENT '是否忽略结果',
`status` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '状态 success|failure',
`exceptionType` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '错误类型',
`exceptionTEXT` longtext COMMENT '错误TEXT',
`tracebackTEXT` longtext COMMENT '调用堆栈TEXT',
`printLogsTEXT` longtext COMMENT 'print日志TEXT',
`returnValueJSON` json COMMENT '返回值JSON',
`responseControlJSON` json COMMENT '响应控制JSON',
`createTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updateTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`seq`),
UNIQUE KEY `ID` (`id`),
KEY `ROOT_TASK_ID` (`rootTaskId`),
KEY `SCRIPT_TASK_ID` (`scriptSetId`),
KEY `SCRIPT_ID` (`scriptId`),
KEY `FUNC_ID` (`funcId`),
KEY `ORIGIN` (`origin`),
KEY `ORIGIN_ID` (`originId`),
KEY `QUEUE` (`queue`),
KEY `STATUS` (`status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='任务记录(函数)';
# 于观测云 SaaS 2024-01-15 迭代中实装
- seq: 27
database: |-
-- 扩充 originId 字段长度
TRUNCATE biz_main_task_record_func;
ALTER TABLE biz_main_task_record_func
MODIFY COLUMN `originId` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT 'UNKNOWN' COMMENT '任务来源 ID';
# 于观测云 SaaS 2024-04-24 迭代中实装
- seq: 28
database: |-
-- 调整列顺序
ALTER TABLE biz_main_env_variable
CHANGE `autoTypeCasting` `autoTypeCasting_bak` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT 'string' COMMENT '自动类型转换 string|password|integer|float|boolean|json|commaArray';
ALTER TABLE biz_main_env_variable
ADD COLUMN `autoTypeCasting` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT 'string' COMMENT '自动类型转换 string|password|integer|float|boolean|json|commaArray'
AFTER `description`;
UPDATE biz_main_env_variable SET `autoTypeCasting` = `autoTypeCasting_bak`;
ALTER TABLE biz_main_env_variable
DROP `autoTypeCasting_bak`;
-- 扩充 AccessKey Secret 字段用于存放加密后内容
ALTER TABLE wat_main_access_key
CHANGE `secret` `secretCipher` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL;
-- 重建任务记录表(增加非关键错误信息)
DROP TABLE IF EXISTS `biz_main_task_record`;
DROP TABLE IF EXISTS `biz_main_task_record_func`;
CREATE TABLE `biz_main_task_record` (
`seq` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
`name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '任务名',
`kwargsJSON` json COMMENT '调用参数JSON',
`triggerTimeMs` bigint(20) unsigned NOT NULL COMMENT '触发时间(UNIX毫秒时间戳)',
`startTimeMs` bigint(20) unsigned NOT NULL COMMENT '启动时间(UNIX毫秒时间戳)',
`endTimeMs` bigint(20) unsigned NOT NULL COMMENT '结束时间(UNIX毫秒时间戳)',
`eta` text COMMENT 'ETA',
`delay` bigint(20) unsigned NOT NULL COMMENT '延迟时间',
`queue` bigint(20) unsigned NOT NULL COMMENT '执行队列',
`timeout` bigint(20) unsigned NOT NULL COMMENT '超时时间',
`expires` bigint(20) unsigned NOT NULL COMMENT '过期时间',
`ignoreResult` tinyint(1) NOT NULL COMMENT '是否忽略结果',
`resultJSON` json COMMENT '结果JSON',
`status` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '状态 success|failure|timeout|skip',
`exceptionType` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '错误类型',
`exceptionTEXT` longtext COMMENT '错误TEXT',
`tracebackTEXT` longtext COMMENT '调用堆栈TEXT',
`nonCriticalErrorsTEXT` longtext COMMENT '非关键错误TEXT',
`createTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updateTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`seq`),
UNIQUE KEY `ID` (`id`),
KEY `NAME` (`name`),
KEY `TRIGGER_TIME_MS` (`triggerTimeMs`),
KEY `QUEUE` (`queue`),
KEY `STATUS` (`status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='任务记录';
CREATE TABLE `biz_main_task_record_func` (
`seq` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
`rootTaskId` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT 'ROOT' COMMENT '主任务ID',
`scriptSetId` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '脚本集ID',
`scriptId` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '脚本ID',
`funcId` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '函数ID',
`funcCallKwargsJSON` json COMMENT '调用参数JSON',
`origin` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT 'UNKNOWN' COMMENT '任务来源',
`originId` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT 'UNKNOWN' COMMENT '任务来源 ID',
`crontab` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '执行频率(Crontab语法)',
`callChainJSON` json COMMENT '函数调用链JSON',
`triggerTimeMs` bigint(20) unsigned NOT NULL COMMENT '触发时间(UNIX毫秒时间戳)',
`startTimeMs` bigint(20) unsigned NOT NULL COMMENT '启动时间(UNIX毫秒时间戳)',
`endTimeMs` bigint(20) unsigned NOT NULL COMMENT '结束时间(UNIX毫秒时间戳)',
`eta` text COMMENT 'ETA',
`delay` bigint(20) unsigned NOT NULL COMMENT '延迟时间',
`queue` bigint(20) unsigned NOT NULL COMMENT '执行队列',
`timeout` bigint(20) unsigned NOT NULL COMMENT '超时时间',
`expires` bigint(20) unsigned NOT NULL COMMENT '过期时间',
`ignoreResult` tinyint(1) NOT NULL COMMENT '是否忽略结果',
`status` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '状态 success|failure',
`exceptionType` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '错误类型',
`exceptionTEXT` longtext COMMENT '错误TEXT',
`tracebackTEXT` longtext COMMENT '调用堆栈TEXT',
`nonCriticalErrorsTEXT` longtext COMMENT '非关键错误TEXT',
`printLogsTEXT` longtext COMMENT 'print日志TEXT',
`returnValueJSON` json COMMENT '返回值JSON',
`responseControlJSON` json COMMENT '响应控制JSON',
`createTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updateTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`seq`),
UNIQUE KEY `ID` (`id`),
KEY `ROOT_TASK_ID` (`rootTaskId`),
KEY `SCRIPT_TASK_ID` (`scriptSetId`),
KEY `SCRIPT_ID` (`scriptId`),
KEY `FUNC_ID` (`funcId`),
KEY `ORIGIN` (`origin`),
KEY `ORIGIN_ID` (`originId`),
KEY `TRIGGER_TIME_MS` (`triggerTimeMs`),
KEY `QUEUE` (`queue`),
KEY `STATUS` (`status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='任务记录(函数)';
# 于观测云 SaaS 2024-05-29 迭代中实装
- seq: 29
database: |-
-- 确保 AccessKey secretCipher 字段为 longtext
ALTER TABLE wat_main_access_key ADD COLUMN `secretCipher_tmp` longtext AFTER `secretCipher`;
UPDATE wat_main_access_key SET `secretCipher_tmp` = `secretCipher`;
ALTER TABLE wat_main_access_key DROP COLUMN `secretCipher`;
ALTER TABLE wat_main_access_key CHANGE `secretCipher_tmp` `secretCipher` longtext;
-- 重命名 crontab 为 cronExpr
ALTER TABLE biz_main_task_record_func
CHANGE `crontab` `cronExpr` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'Cron 表达式';
-- 启用新命名
CREATE TABLE `biz_main_sync_api` (
`seq` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '兼任Token',
`funcId` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '函数ID',
`funcCallKwargsJSON` json DEFAULT NULL COMMENT '函数调用参数JSON (kwargs)',
`tagsJSON` json DEFAULT NULL COMMENT '标签JSON',
`apiAuthId` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'API认证ID',
`expireTime` datetime DEFAULT NULL COMMENT '过期时间(NULL表示永不过期)',
`throttlingJSON` json DEFAULT NULL COMMENT '限流JSON',
`origin` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT 'UNKNOWN' COMMENT '来源',
`originId` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT 'UNKNOWN' COMMENT '来源ID',
`showInDoc` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否在文档中显示',
`taskRecordLimit` int(11) DEFAULT NULL COMMENT '任务记录数量',
`isDisabled` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否禁用',
`note` text COMMENT '备注',
`createTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updateTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`seq`),
UNIQUE KEY `ID` (`id`),
KEY `ORIGIN` (`origin`),
KEY `ORIGIN_ID` (`originId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='同步 API';
CREATE TABLE `biz_main_async_api` (
`seq` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '兼任Token',
`funcId` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '函数ID',
`funcCallKwargsJSON` json DEFAULT NULL COMMENT '函数调用参数JSON (kwargs)',
`tagsJSON` json DEFAULT NULL COMMENT '标签JSON',
`apiAuthId` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'API认证ID',
`origin` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT 'UNKNOWN' COMMENT '来源',
`originId` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT 'UNKNOWN' COMMENT '来源ID',
`showInDoc` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否在文档中显示',
`taskRecordLimit` int(11) DEFAULT NULL COMMENT '任务记录数量',
`isDisabled` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否禁用',
`note` text COMMENT '备注',
`createTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updateTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`seq`),
UNIQUE KEY `ID` (`id`),
KEY `ORIGIN` (`origin`),
KEY `ORIGIN_ID` (`originId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='异步 API';
CREATE TABLE `biz_main_cron_job` (
`seq` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
`funcId` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '函数ID',
`funcCallKwargsJSON` json DEFAULT NULL COMMENT '函数调用参数JSON (kwargs)',
`cronExpr` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '执行频率(Cron表达式)',
`timezone` varchar(256) DEFAULT NULL COMMENT '时区',
`tagsJSON` json DEFAULT NULL COMMENT '标签JSON',
`scope` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT 'GLOBAL' COMMENT '范围',
`configMD5` char(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '配置MD5',
`expireTime` timestamp NULL DEFAULT NULL COMMENT '过期时间',
`origin` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT 'UNKNOWN' COMMENT '来源',
`originId` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT 'UNKNOWN' COMMENT '来源ID',
`taskRecordLimit` int(11) DEFAULT NULL COMMENT '任务记录数量',
`isDisabled` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否已禁用',
`note` text COMMENT '备注',
`createTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updateTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`seq`),
UNIQUE KEY `ID` (`id`),
UNIQUE KEY `SCOPE_CONFIG` (`scope`,`configMD5`),
KEY `ORIGIN` (`origin`),
KEY `ORIGIN_ID` (`originId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='定时任务';
-- 复制数据
INSERT INTO biz_main_sync_api
SELECT
NULL,
`id`,
`funcId`,
`funcCallKwargsJSON`,
`tagsJSON`,
`apiAuthId`,
`expireTime`,
`throttlingJSON`,
`origin`,
`originId`,
`showInDoc`,
`taskRecordLimit`,
`isDisabled`,
`note`,
`createTime`,
`updateTime`
FROM biz_main_auth_link;
INSERT INTO biz_main_async_api
SELECT
NULL,
`id`,
`funcId`,
`funcCallKwargsJSON`,
`tagsJSON`,
`apiAuthId`,
`origin`,
`originId`,
`showInDoc`,
`taskRecordLimit`,
`isDisabled`,
`note`,
`createTime`,
`updateTime`
FROM biz_main_batch;
INSERT INTO biz_main_cron_job
SELECT
NULL,
`id`,
`funcId`,
`funcCallKwargsJSON`,
`crontab`,
`timezone`,
`tagsJSON`,
`scope`,
`configMD5`,
`expireTime`,
`origin`,
`originId`,
`taskRecordLimit`,
`isDisabled`,
`note`,
`createTime`,
`updateTime`
FROM biz_main_crontab_config;
# 从此版本开始,同时支持 MySQL 和 PostgreSQL,变化较大
- seq: 100
mysql: |-
-- 清空部分日志类表
TRUNCATE biz_main_script_publish_history;
TRUNCATE biz_main_script_recover_point;
TRUNCATE biz_main_script_set_export_history;
TRUNCATE biz_main_script_set_import_history;
TRUNCATE biz_main_operation_record;
TRUNCATE biz_main_task_record;
TRUNCATE biz_main_task_record_func;
-- 所有表默认 COLLATE 改为 utf8mb4_general_ci
ALTER TABLE `biz_main_api_auth` COLLATE utf8mb4_general_ci;
ALTER TABLE `biz_main_async_api` COLLATE utf8mb4_general_ci;
ALTER TABLE `biz_main_blueprint` COLLATE utf8mb4_general_ci;
ALTER TABLE `biz_main_connector` COLLATE utf8mb4_general_ci;
ALTER TABLE `biz_main_cron_job` COLLATE utf8mb4_general_ci;
ALTER TABLE `biz_main_env_variable` COLLATE utf8mb4_general_ci;
ALTER TABLE `biz_main_file_service` COLLATE utf8mb4_general_ci;
ALTER TABLE `biz_main_func` COLLATE utf8mb4_general_ci;
ALTER TABLE `biz_main_func_store` COLLATE utf8mb4_general_ci;
ALTER TABLE `biz_main_operation_record` COLLATE utf8mb4_general_ci;
ALTER TABLE `biz_main_script` COLLATE utf8mb4_general_ci;
ALTER TABLE `biz_main_script_market` COLLATE utf8mb4_general_ci;
ALTER TABLE `biz_main_script_publish_history` COLLATE utf8mb4_general_ci;
ALTER TABLE `biz_main_script_recover_point` COLLATE utf8mb4_general_ci;
ALTER TABLE `biz_main_script_set` COLLATE utf8mb4_general_ci;
ALTER TABLE `biz_main_script_set_export_history` COLLATE utf8mb4_general_ci;
ALTER TABLE `biz_main_script_set_import_history` COLLATE utf8mb4_general_ci;
ALTER TABLE `biz_main_sync_api` COLLATE utf8mb4_general_ci;
ALTER TABLE `biz_main_task_record` COLLATE utf8mb4_general_ci;
ALTER TABLE `biz_main_task_record_func` COLLATE utf8mb4_general_ci;
ALTER TABLE `wat_main_access_key` COLLATE utf8mb4_general_ci;
ALTER TABLE `wat_main_system_setting` COLLATE utf8mb4_general_ci;
ALTER TABLE `wat_main_user` COLLATE utf8mb4_general_ci;
-- 所有表修改 createTime 字段类型为 bigint
ALTER TABLE `biz_main_task_record` ADD COLUMN `createTime_tmp` bigint(20) unsigned NOT NULL DEFAULT 0 AFTER `createTime`;
UPDATE `biz_main_task_record` SET `createTime_tmp` = UNIX_TIMESTAMP(`createTime`);
ALTER TABLE `biz_main_task_record` DROP COLUMN `createTime`;
ALTER TABLE `biz_main_task_record` CHANGE `createTime_tmp` `createTime` bigint(20) unsigned NOT NULL DEFAULT 0;
ALTER TABLE `biz_main_task_record_func` ADD COLUMN `createTime_tmp` bigint(20) unsigned NOT NULL DEFAULT 0 AFTER `createTime`;
UPDATE `biz_main_task_record_func` SET `createTime_tmp` = UNIX_TIMESTAMP(`createTime`);
ALTER TABLE `biz_main_task_record_func` DROP COLUMN `createTime`;
ALTER TABLE `biz_main_task_record_func` CHANGE `createTime_tmp` `createTime` bigint(20) unsigned NOT NULL DEFAULT 0;
ALTER TABLE `biz_main_api_auth` ADD COLUMN `createTime_tmp` bigint(20) unsigned NOT NULL DEFAULT 0 AFTER `createTime`;
UPDATE `biz_main_api_auth` SET `createTime_tmp` = UNIX_TIMESTAMP(`createTime`);
ALTER TABLE `biz_main_api_auth` DROP COLUMN `createTime`;
ALTER TABLE `biz_main_api_auth` CHANGE `createTime_tmp` `createTime` bigint(20) unsigned NOT NULL DEFAULT 0;
ALTER TABLE `biz_main_sync_api` ADD COLUMN `createTime_tmp` bigint(20) unsigned NOT NULL DEFAULT 0 AFTER `createTime`;
UPDATE `biz_main_sync_api` SET `createTime_tmp` = UNIX_TIMESTAMP(`createTime`);
ALTER TABLE `biz_main_sync_api` DROP COLUMN `createTime`;
ALTER TABLE `biz_main_sync_api` CHANGE `createTime_tmp` `createTime` bigint(20) unsigned NOT NULL DEFAULT 0;
ALTER TABLE `biz_main_async_api` ADD COLUMN `createTime_tmp` bigint(20) unsigned NOT NULL DEFAULT 0 AFTER `createTime`;
UPDATE `biz_main_async_api` SET `createTime_tmp` = UNIX_TIMESTAMP(`createTime`);
ALTER TABLE `biz_main_async_api` DROP COLUMN `createTime`;
ALTER TABLE `biz_main_async_api` CHANGE `createTime_tmp` `createTime` bigint(20) unsigned NOT NULL DEFAULT 0;
ALTER TABLE `biz_main_blueprint` ADD COLUMN `createTime_tmp` bigint(20) unsigned NOT NULL DEFAULT 0 AFTER `createTime`;
UPDATE `biz_main_blueprint` SET `createTime_tmp` = UNIX_TIMESTAMP(`createTime`);
ALTER TABLE `biz_main_blueprint` DROP COLUMN `createTime`;
ALTER TABLE `biz_main_blueprint` CHANGE `createTime_tmp` `createTime` bigint(20) unsigned NOT NULL DEFAULT 0;
ALTER TABLE `biz_main_connector` ADD COLUMN `createTime_tmp` bigint(20) unsigned NOT NULL DEFAULT 0 AFTER `createTime`;
UPDATE `biz_main_connector` SET `createTime_tmp` = UNIX_TIMESTAMP(`createTime`);
ALTER TABLE `biz_main_connector` DROP COLUMN `createTime`;
ALTER TABLE `biz_main_connector` CHANGE `createTime_tmp` `createTime` bigint(20) unsigned NOT NULL DEFAULT 0;
ALTER TABLE `biz_main_cron_job` ADD COLUMN `createTime_tmp` bigint(20) unsigned NOT NULL DEFAULT 0 AFTER `createTime`;
UPDATE `biz_main_cron_job` SET `createTime_tmp` = UNIX_TIMESTAMP(`createTime`);
ALTER TABLE `biz_main_cron_job` DROP COLUMN `createTime`;
ALTER TABLE `biz_main_cron_job` CHANGE `createTime_tmp` `createTime` bigint(20) unsigned NOT NULL DEFAULT 0;
ALTER TABLE `biz_main_env_variable` ADD COLUMN `createTime_tmp` bigint(20) unsigned NOT NULL DEFAULT 0 AFTER `createTime`;
UPDATE `biz_main_env_variable` SET `createTime_tmp` = UNIX_TIMESTAMP(`createTime`);
ALTER TABLE `biz_main_env_variable` DROP COLUMN `createTime`;
ALTER TABLE `biz_main_env_variable` CHANGE `createTime_tmp` `createTime` bigint(20) unsigned NOT NULL DEFAULT 0;
ALTER TABLE `biz_main_file_service` ADD COLUMN `createTime_tmp` bigint(20) unsigned NOT NULL DEFAULT 0 AFTER `createTime`;
UPDATE `biz_main_file_service` SET `createTime_tmp` = UNIX_TIMESTAMP(`createTime`);
ALTER TABLE `biz_main_file_service` DROP COLUMN `createTime`;
ALTER TABLE `biz_main_file_service` CHANGE `createTime_tmp` `createTime` bigint(20) unsigned NOT NULL DEFAULT 0;
ALTER TABLE `biz_main_func` ADD COLUMN `createTime_tmp` bigint(20) unsigned NOT NULL DEFAULT 0 AFTER `createTime`;
UPDATE `biz_main_func` SET `createTime_tmp` = UNIX_TIMESTAMP(`createTime`);
ALTER TABLE `biz_main_func` DROP COLUMN `createTime`;
ALTER TABLE `biz_main_func` CHANGE `createTime_tmp` `createTime` bigint(20) unsigned NOT NULL DEFAULT 0;
ALTER TABLE `biz_main_func_store` ADD COLUMN `createTime_tmp` bigint(20) unsigned NOT NULL DEFAULT 0 AFTER `createTime`;
UPDATE `biz_main_func_store` SET `createTime_tmp` = UNIX_TIMESTAMP(`createTime`);
ALTER TABLE `biz_main_func_store` DROP COLUMN `createTime`;
ALTER TABLE `biz_main_func_store` CHANGE `createTime_tmp` `createTime` bigint(20) unsigned NOT NULL DEFAULT 0;
ALTER TABLE `biz_main_operation_record` ADD COLUMN `createTime_tmp` bigint(20) unsigned NOT NULL DEFAULT 0 AFTER `createTime`;
UPDATE `biz_main_operation_record` SET `createTime_tmp` = UNIX_TIMESTAMP(`createTime`);
ALTER TABLE `biz_main_operation_record` DROP COLUMN `createTime`;
ALTER TABLE `biz_main_operation_record` CHANGE `createTime_tmp` `createTime` bigint(20) unsigned NOT NULL DEFAULT 0;
ALTER TABLE `biz_main_script` ADD COLUMN `createTime_tmp` bigint(20) unsigned NOT NULL DEFAULT 0 AFTER `createTime`;
UPDATE `biz_main_script` SET `createTime_tmp` = UNIX_TIMESTAMP(`createTime`);
ALTER TABLE `biz_main_script` DROP COLUMN `createTime`;
ALTER TABLE `biz_main_script` CHANGE `createTime_tmp` `createTime` bigint(20) unsigned NOT NULL DEFAULT 0;
ALTER TABLE `biz_main_script_market` ADD COLUMN `createTime_tmp` bigint(20) unsigned NOT NULL DEFAULT 0 AFTER `createTime`;
UPDATE `biz_main_script_market` SET `createTime_tmp` = UNIX_TIMESTAMP(`createTime`);
ALTER TABLE `biz_main_script_market` DROP COLUMN `createTime`;
ALTER TABLE `biz_main_script_market` CHANGE `createTime_tmp` `createTime` bigint(20) unsigned NOT NULL DEFAULT 0;
ALTER TABLE `biz_main_script_publish_history` ADD COLUMN `createTime_tmp` bigint(20) unsigned NOT NULL DEFAULT 0 AFTER `createTime`;
UPDATE `biz_main_script_publish_history` SET `createTime_tmp` = UNIX_TIMESTAMP(`createTime`);
ALTER TABLE `biz_main_script_publish_history` DROP COLUMN `createTime`;
ALTER TABLE `biz_main_script_publish_history` CHANGE `createTime_tmp` `createTime` bigint(20) unsigned NOT NULL DEFAULT 0;
ALTER TABLE `biz_main_script_recover_point` ADD COLUMN `createTime_tmp` bigint(20) unsigned NOT NULL DEFAULT 0 AFTER `createTime`;
UPDATE `biz_main_script_recover_point` SET `createTime_tmp` = UNIX_TIMESTAMP(`createTime`);
ALTER TABLE `biz_main_script_recover_point` DROP COLUMN `createTime`;
ALTER TABLE `biz_main_script_recover_point` CHANGE `createTime_tmp` `createTime` bigint(20) unsigned NOT NULL DEFAULT 0;
ALTER TABLE `biz_main_script_set` ADD COLUMN `createTime_tmp` bigint(20) unsigned NOT NULL DEFAULT 0 AFTER `createTime`;
UPDATE `biz_main_script_set` SET `createTime_tmp` = UNIX_TIMESTAMP(`createTime`);
ALTER TABLE `biz_main_script_set` DROP COLUMN `createTime`;
ALTER TABLE `biz_main_script_set` CHANGE `createTime_tmp` `createTime` bigint(20) unsigned NOT NULL DEFAULT 0;
ALTER TABLE `biz_main_script_set_export_history` ADD COLUMN `createTime_tmp` bigint(20) unsigned NOT NULL DEFAULT 0 AFTER `createTime`;
UPDATE `biz_main_script_set_export_history` SET `createTime_tmp` = UNIX_TIMESTAMP(`createTime`);
ALTER TABLE `biz_main_script_set_export_history` DROP COLUMN `createTime`;
ALTER TABLE `biz_main_script_set_export_history` CHANGE `createTime_tmp` `createTime` bigint(20) unsigned NOT NULL DEFAULT 0;
ALTER TABLE `biz_main_script_set_import_history` ADD COLUMN `createTime_tmp` bigint(20) unsigned NOT NULL DEFAULT 0 AFTER `createTime`;
UPDATE `biz_main_script_set_import_history` SET `createTime_tmp` = UNIX_TIMESTAMP(`createTime`);
ALTER TABLE `biz_main_script_set_import_history` DROP COLUMN `createTime`;
ALTER TABLE `biz_main_script_set_import_history` CHANGE `createTime_tmp` `createTime` bigint(20) unsigned NOT NULL DEFAULT 0;
ALTER TABLE `wat_main_access_key` ADD COLUMN `createTime_tmp` bigint(20) unsigned NOT NULL DEFAULT 0 AFTER `createTime`;
UPDATE `wat_main_access_key` SET `createTime_tmp` = UNIX_TIMESTAMP(`createTime`);
ALTER TABLE `wat_main_access_key` DROP COLUMN `createTime`;
ALTER TABLE `wat_main_access_key` CHANGE `createTime_tmp` `createTime` bigint(20) unsigned NOT NULL DEFAULT 0;
ALTER TABLE `wat_main_system_setting` ADD COLUMN `createTime_tmp` bigint(20) unsigned NOT NULL DEFAULT 0 AFTER `createTime`;
UPDATE `wat_main_system_setting` SET `createTime_tmp` = UNIX_TIMESTAMP(`createTime`);
ALTER TABLE `wat_main_system_setting` DROP COLUMN `createTime`;
ALTER TABLE `wat_main_system_setting` CHANGE `createTime_tmp` `createTime` bigint(20) unsigned NOT NULL DEFAULT 0;
ALTER TABLE `wat_main_user` ADD COLUMN `createTime_tmp` bigint(20) unsigned NOT NULL DEFAULT 0 AFTER `createTime`;
UPDATE `wat_main_user` SET `createTime_tmp` = UNIX_TIMESTAMP(`createTime`);
ALTER TABLE `wat_main_user` DROP COLUMN `createTime`;
ALTER TABLE `wat_main_user` CHANGE `createTime_tmp` `createTime` bigint(20) unsigned NOT NULL DEFAULT 0;
-- 所有表修改 updateTime 字段类型为 bigint
ALTER TABLE `biz_main_task_record` ADD COLUMN `updateTime_tmp` bigint(20) unsigned NOT NULL DEFAULT 0 AFTER `updateTime`;
UPDATE `biz_main_task_record` SET `updateTime_tmp` = UNIX_TIMESTAMP(`updateTime`);
ALTER TABLE `biz_main_task_record` DROP COLUMN `updateTime`;
ALTER TABLE `biz_main_task_record` CHANGE `updateTime_tmp` `updateTime` bigint(20) unsigned NOT NULL DEFAULT 0;
ALTER TABLE `biz_main_task_record_func` ADD COLUMN `updateTime_tmp` bigint(20) unsigned NOT NULL DEFAULT 0 AFTER `updateTime`;
UPDATE `biz_main_task_record_func` SET `updateTime_tmp` = UNIX_TIMESTAMP(`updateTime`);
ALTER TABLE `biz_main_task_record_func` DROP COLUMN `updateTime`;
ALTER TABLE `biz_main_task_record_func` CHANGE `updateTime_tmp` `updateTime` bigint(20) unsigned NOT NULL DEFAULT 0;
ALTER TABLE `biz_main_api_auth` ADD COLUMN `updateTime_tmp` bigint(20) unsigned NOT NULL DEFAULT 0 AFTER `updateTime`;
UPDATE `biz_main_api_auth` SET `updateTime_tmp` = UNIX_TIMESTAMP(`updateTime`);
ALTER TABLE `biz_main_api_auth` DROP COLUMN `updateTime`;
ALTER TABLE `biz_main_api_auth` CHANGE `updateTime_tmp` `updateTime` bigint(20) unsigned NOT NULL DEFAULT 0;
ALTER TABLE `biz_main_sync_api` ADD COLUMN `updateTime_tmp` bigint(20) unsigned NOT NULL DEFAULT 0 AFTER `updateTime`;
UPDATE `biz_main_sync_api` SET `updateTime_tmp` = UNIX_TIMESTAMP(`updateTime`);
ALTER TABLE `biz_main_sync_api` DROP COLUMN `updateTime`;
ALTER TABLE `biz_main_sync_api` CHANGE `updateTime_tmp` `updateTime` bigint(20) unsigned NOT NULL DEFAULT 0;
ALTER TABLE `biz_main_async_api` ADD COLUMN `updateTime_tmp` bigint(20) unsigned NOT NULL DEFAULT 0 AFTER `updateTime`;
UPDATE `biz_main_async_api` SET `updateTime_tmp` = UNIX_TIMESTAMP(`updateTime`);
ALTER TABLE `biz_main_async_api` DROP COLUMN `updateTime`;
ALTER TABLE `biz_main_async_api` CHANGE `updateTime_tmp` `updateTime` bigint(20) unsigned NOT NULL DEFAULT 0;
ALTER TABLE `biz_main_blueprint` ADD COLUMN `updateTime_tmp` bigint(20) unsigned NOT NULL DEFAULT 0 AFTER `updateTime`;
UPDATE `biz_main_blueprint` SET `updateTime_tmp` = UNIX_TIMESTAMP(`updateTime`);
ALTER TABLE `biz_main_blueprint` DROP COLUMN `updateTime`;
ALTER TABLE `biz_main_blueprint` CHANGE `updateTime_tmp` `updateTime` bigint(20) unsigned NOT NULL DEFAULT 0;
ALTER TABLE `biz_main_connector` ADD COLUMN `updateTime_tmp` bigint(20) unsigned NOT NULL DEFAULT 0 AFTER `updateTime`;
UPDATE `biz_main_connector` SET `updateTime_tmp` = UNIX_TIMESTAMP(`updateTime`);
ALTER TABLE `biz_main_connector` DROP COLUMN `updateTime`;
ALTER TABLE `biz_main_connector` CHANGE `updateTime_tmp` `updateTime` bigint(20) unsigned NOT NULL DEFAULT 0;
ALTER TABLE `biz_main_cron_job` ADD COLUMN `updateTime_tmp` bigint(20) unsigned NOT NULL DEFAULT 0 AFTER `updateTime`;
UPDATE `biz_main_cron_job` SET `updateTime_tmp` = UNIX_TIMESTAMP(`updateTime`);
ALTER TABLE `biz_main_cron_job` DROP COLUMN `updateTime`;
ALTER TABLE `biz_main_cron_job` CHANGE `updateTime_tmp` `updateTime` bigint(20) unsigned NOT NULL DEFAULT 0;
ALTER TABLE `biz_main_env_variable` ADD COLUMN `updateTime_tmp` bigint(20) unsigned NOT NULL DEFAULT 0 AFTER `updateTime`;
UPDATE `biz_main_env_variable` SET `updateTime_tmp` = UNIX_TIMESTAMP(`updateTime`);
ALTER TABLE `biz_main_env_variable` DROP COLUMN `updateTime`;
ALTER TABLE `biz_main_env_variable` CHANGE `updateTime_tmp` `updateTime` bigint(20) unsigned NOT NULL DEFAULT 0;
ALTER TABLE `biz_main_file_service` ADD COLUMN `updateTime_tmp` bigint(20) unsigned NOT NULL DEFAULT 0 AFTER `updateTime`;
UPDATE `biz_main_file_service` SET `updateTime_tmp` = UNIX_TIMESTAMP(`updateTime`);
ALTER TABLE `biz_main_file_service` DROP COLUMN `updateTime`;
ALTER TABLE `biz_main_file_service` CHANGE `updateTime_tmp` `updateTime` bigint(20) unsigned NOT NULL DEFAULT 0;
ALTER TABLE `biz_main_func` ADD COLUMN `updateTime_tmp` bigint(20) unsigned NOT NULL DEFAULT 0 AFTER `updateTime`;
UPDATE `biz_main_func` SET `updateTime_tmp` = UNIX_TIMESTAMP(`updateTime`);
ALTER TABLE `biz_main_func` DROP COLUMN `updateTime`;
ALTER TABLE `biz_main_func` CHANGE `updateTime_tmp` `updateTime` bigint(20) unsigned NOT NULL DEFAULT 0;
ALTER TABLE `biz_main_func_store` ADD COLUMN `updateTime_tmp` bigint(20) unsigned NOT NULL DEFAULT 0 AFTER `updateTime`;
UPDATE `biz_main_func_store` SET `updateTime_tmp` = UNIX_TIMESTAMP(`updateTime`);
ALTER TABLE `biz_main_func_store` DROP COLUMN `updateTime`;
ALTER TABLE `biz_main_func_store` CHANGE `updateTime_tmp` `updateTime` bigint(20) unsigned NOT NULL DEFAULT 0;
ALTER TABLE `biz_main_operation_record` ADD COLUMN `updateTime_tmp` bigint(20) unsigned NOT NULL DEFAULT 0 AFTER `updateTime`;
UPDATE `biz_main_operation_record` SET `updateTime_tmp` = UNIX_TIMESTAMP(`updateTime`);
ALTER TABLE `biz_main_operation_record` DROP COLUMN `updateTime`;
ALTER TABLE `biz_main_operation_record` CHANGE `updateTime_tmp` `updateTime` bigint(20) unsigned NOT NULL DEFAULT 0;
ALTER TABLE `biz_main_script` ADD COLUMN `updateTime_tmp` bigint(20) unsigned NOT NULL DEFAULT 0 AFTER `updateTime`;
UPDATE `biz_main_script` SET `updateTime_tmp` = UNIX_TIMESTAMP(`updateTime`);
ALTER TABLE `biz_main_script` DROP COLUMN `updateTime`;
ALTER TABLE `biz_main_script` CHANGE `updateTime_tmp` `updateTime` bigint(20) unsigned NOT NULL DEFAULT 0;
ALTER TABLE `biz_main_script_market` ADD COLUMN `updateTime_tmp` bigint(20) unsigned NOT NULL DEFAULT 0 AFTER `updateTime`;
UPDATE `biz_main_script_market` SET `updateTime_tmp` = UNIX_TIMESTAMP(`updateTime`);
ALTER TABLE `biz_main_script_market` DROP COLUMN `updateTime`;
ALTER TABLE `biz_main_script_market` CHANGE `updateTime_tmp` `updateTime` bigint(20) unsigned NOT NULL DEFAULT 0;
ALTER TABLE `biz_main_script_publish_history` ADD COLUMN `updateTime_tmp` bigint(20) unsigned NOT NULL DEFAULT 0 AFTER `updateTime`;
UPDATE `biz_main_script_publish_history` SET `updateTime_tmp` = UNIX_TIMESTAMP(`updateTime`);
ALTER TABLE `biz_main_script_publish_history` DROP COLUMN `updateTime`;
ALTER TABLE `biz_main_script_publish_history` CHANGE `updateTime_tmp` `updateTime` bigint(20) unsigned NOT NULL DEFAULT 0;
ALTER TABLE `biz_main_script_recover_point` ADD COLUMN `updateTime_tmp` bigint(20) unsigned NOT NULL DEFAULT 0 AFTER `updateTime`;
UPDATE `biz_main_script_recover_point` SET `updateTime_tmp` = UNIX_TIMESTAMP(`updateTime`);
ALTER TABLE `biz_main_script_recover_point` DROP COLUMN `updateTime`;
ALTER TABLE `biz_main_script_recover_point` CHANGE `updateTime_tmp` `updateTime` bigint(20) unsigned NOT NULL DEFAULT 0;
ALTER TABLE `biz_main_script_set` ADD COLUMN `updateTime_tmp` bigint(20) unsigned NOT NULL DEFAULT 0 AFTER `updateTime`;
UPDATE `biz_main_script_set` SET `updateTime_tmp` = UNIX_TIMESTAMP(`updateTime`);
ALTER TABLE `biz_main_script_set` DROP COLUMN `updateTime`;
ALTER TABLE `biz_main_script_set` CHANGE `updateTime_tmp` `updateTime` bigint(20) unsigned NOT NULL DEFAULT 0;
ALTER TABLE `biz_main_script_set_export_history` ADD COLUMN `updateTime_tmp` bigint(20) unsigned NOT NULL DEFAULT 0 AFTER `updateTime`;
UPDATE `biz_main_script_set_export_history` SET `updateTime_tmp` = UNIX_TIMESTAMP(`updateTime`);
ALTER TABLE `biz_main_script_set_export_history` DROP COLUMN `updateTime`;
ALTER TABLE `biz_main_script_set_export_history` CHANGE `updateTime_tmp` `updateTime` bigint(20) unsigned NOT NULL DEFAULT 0;
ALTER TABLE `biz_main_script_set_import_history` ADD COLUMN `updateTime_tmp` bigint(20) unsigned NOT NULL DEFAULT 0 AFTER `updateTime`;
UPDATE `biz_main_script_set_import_history` SET `updateTime_tmp` = UNIX_TIMESTAMP(`updateTime`);
ALTER TABLE `biz_main_script_set_import_history` DROP COLUMN `updateTime`;
ALTER TABLE `biz_main_script_set_import_history` CHANGE `updateTime_tmp` `updateTime` bigint(20) unsigned NOT NULL DEFAULT 0;
ALTER TABLE `wat_main_access_key` ADD COLUMN `updateTime_tmp` bigint(20) unsigned NOT NULL DEFAULT 0 AFTER `updateTime`;
UPDATE `wat_main_access_key` SET `updateTime_tmp` = UNIX_TIMESTAMP(`updateTime`);
ALTER TABLE `wat_main_access_key` DROP COLUMN `updateTime`;
ALTER TABLE `wat_main_access_key` CHANGE `updateTime_tmp` `updateTime` bigint(20) unsigned NOT NULL DEFAULT 0;
ALTER TABLE `wat_main_system_setting` ADD COLUMN `updateTime_tmp` bigint(20) unsigned NOT NULL DEFAULT 0 AFTER `updateTime`;
UPDATE `wat_main_system_setting` SET `updateTime_tmp` = UNIX_TIMESTAMP(`updateTime`);
ALTER TABLE `wat_main_system_setting` DROP COLUMN `updateTime`;
ALTER TABLE `wat_main_system_setting` CHANGE `updateTime_tmp` `updateTime` bigint(20) unsigned NOT NULL DEFAULT 0;
ALTER TABLE `wat_main_user` ADD COLUMN `updateTime_tmp` bigint(20) unsigned NOT NULL DEFAULT 0 AFTER `updateTime`;
UPDATE `wat_main_user` SET `updateTime_tmp` = UNIX_TIMESTAMP(`updateTime`);
ALTER TABLE `wat_main_user` DROP COLUMN `updateTime`;
ALTER TABLE `wat_main_user` CHANGE `updateTime_tmp` `updateTime` bigint(20) unsigned NOT NULL DEFAULT 0;
-- 所有 expireTime 字段类型改为 bigint(20)
ALTER TABLE `biz_main_sync_api` ADD COLUMN `expireTime_tmp` bigint(20) unsigned DEFAULT NULL COMMENT '过期时间(NULL表示永不过期)' AFTER `expireTime`;
UPDATE `biz_main_sync_api` SET `expireTime_tmp` = UNIX_TIMESTAMP(`expireTime`);
ALTER TABLE `biz_main_sync_api` DROP COLUMN `expireTime`;
ALTER TABLE `biz_main_sync_api` CHANGE `expireTime_tmp` `expireTime` bigint(20) unsigned DEFAULT NULL COMMENT '过期时间(NULL表示永不过期)';
ALTER TABLE `biz_main_cron_job` ADD COLUMN `expireTime_tmp` bigint(20) unsigned DEFAULT NULL COMMENT '过期时间(NULL表示永不过期)' AFTER `expireTime`;
UPDATE `biz_main_cron_job` SET `expireTime_tmp` = UNIX_TIMESTAMP(`expireTime`);
ALTER TABLE `biz_main_cron_job` DROP COLUMN `expireTime`;
ALTER TABLE `biz_main_cron_job` CHANGE `expireTime_tmp` `expireTime` bigint(20) unsigned DEFAULT NULL COMMENT '过期时间(NULL表示永不过期)';
-- 异步 API 补充 expireTime,throttlingJSON 字段
ALTER TABLE `biz_main_async_api` ADD COLUMN `expireTime` bigint(20) unsigned DEFAULT NULL COMMENT '过期时间(NULL表示永不过期)' AFTER `apiAuthId`;
ALTER TABLE `biz_main_async_api` ADD COLUMN `throttlingJSON` longtext DEFAULT NULL COMMENT '限流JSON' AFTER `expireTime`;
-- 所有 pinTime 字段类型改为 bigint(20)
ALTER TABLE `biz_main_script_set` ADD COLUMN `pinTime_tmp` bigint(20) unsigned DEFAULT NULL COMMENT '置顶时间' AFTER `pinTime`;
UPDATE `biz_main_script_set` SET `pinTime_tmp` = UNIX_TIMESTAMP(`pinTime`);
ALTER TABLE `biz_main_script_set` DROP COLUMN `pinTime`;
ALTER TABLE `biz_main_script_set` CHANGE `pinTime_tmp` `pinTime` bigint(20) unsigned DEFAULT NULL COMMENT '置顶时间';
ALTER TABLE `biz_main_connector` ADD COLUMN `pinTime_tmp` bigint(20) unsigned DEFAULT NULL COMMENT '置顶时间' AFTER `pinTime`;
UPDATE `biz_main_connector` SET `pinTime_tmp` = UNIX_TIMESTAMP(`pinTime`);
ALTER TABLE `biz_main_connector` DROP COLUMN `pinTime`;
ALTER TABLE `biz_main_connector` CHANGE `pinTime_tmp` `pinTime` bigint(20) unsigned DEFAULT NULL COMMENT '置顶时间';
ALTER TABLE `biz_main_env_variable` ADD COLUMN `pinTime_tmp` bigint(20) unsigned DEFAULT NULL COMMENT '置顶时间' AFTER `pinTime`;
UPDATE `biz_main_env_variable` SET `pinTime_tmp` = UNIX_TIMESTAMP(`pinTime`);
ALTER TABLE `biz_main_env_variable` DROP COLUMN `pinTime`;
ALTER TABLE `biz_main_env_variable` CHANGE `pinTime_tmp` `pinTime` bigint(20) unsigned DEFAULT NULL COMMENT '置顶时间';
ALTER TABLE `biz_main_script_market` ADD COLUMN `pinTime_tmp` bigint(20) unsigned DEFAULT NULL COMMENT '置顶时间' AFTER `pinTime`;
UPDATE `biz_main_script_market` SET `pinTime_tmp` = UNIX_TIMESTAMP(`pinTime`);
ALTER TABLE `biz_main_script_market` DROP COLUMN `pinTime`;
ALTER TABLE `biz_main_script_market` CHANGE `pinTime_tmp` `pinTime` bigint(20) unsigned DEFAULT NULL COMMENT '置顶时间';
-- biz_main_func 表 extraConfigJSON 中 isHidden 字段提取为独立字段
ALTER TABLE `biz_main_func` ADD COLUMN `isHidden` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否已隐藏' AFTER `defOrder`;
UPDATE `biz_main_func` SET `isHidden` = IFNULL(JSON_UNQUOTE(JSON_EXTRACT(`extraConfigJSON`, '$.isHidden')) = 'true', 0);
-- biz_main_api_auth 表 configJSON 中 funcId 字段提取为独立字段
ALTER TABLE `biz_main_api_auth` ADD COLUMN `funcId` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '函数ID' AFTER `type`;
UPDATE `biz_main_api_auth` SET `funcId` = JSON_UNQUOTE(JSON_EXTRACT(`configJSON`, '$.funcId'));
-- 所有 JSON 字段改为 longtext
ALTER TABLE `biz_main_api_auth` ADD COLUMN `configJSON_tmp` longtext NOT NULL COMMENT '配置JSON' AFTER `configJSON`;
UPDATE `biz_main_api_auth` SET `configJSON_tmp` = `configJSON`;
ALTER TABLE `biz_main_api_auth` DROP COLUMN `configJSON`;
ALTER TABLE `biz_main_api_auth` CHANGE `configJSON_tmp` `configJSON` longtext NOT NULL COMMENT '配置JSON';
ALTER TABLE `biz_main_async_api` ADD COLUMN `funcCallKwargsJSON_tmp` longtext DEFAULT NULL COMMENT '函数调用参数JSON (kwargs)' AFTER `funcCallKwargsJSON`;
UPDATE `biz_main_async_api` SET `funcCallKwargsJSON_tmp` = `funcCallKwargsJSON`;
ALTER TABLE `biz_main_async_api` DROP COLUMN `funcCallKwargsJSON`;
ALTER TABLE `biz_main_async_api` CHANGE `funcCallKwargsJSON_tmp` `funcCallKwargsJSON` longtext DEFAULT NULL COMMENT '函数调用参数JSON (kwargs)';
ALTER TABLE `biz_main_async_api` ADD COLUMN `tagsJSON_tmp` longtext DEFAULT NULL COMMENT '标签JSON' AFTER `tagsJSON`;
UPDATE `biz_main_async_api` SET `tagsJSON_tmp` = `tagsJSON`;
ALTER TABLE `biz_main_async_api` DROP COLUMN `tagsJSON`;
ALTER TABLE `biz_main_async_api` CHANGE `tagsJSON_tmp` `tagsJSON` longtext DEFAULT NULL COMMENT '标签JSON';
ALTER TABLE `biz_main_blueprint` ADD COLUMN `canvasJSON_tmp` longtext NOT NULL COMMENT '画布JSON' AFTER `canvasJSON`;
UPDATE `biz_main_blueprint` SET `canvasJSON_tmp` = `canvasJSON`;
ALTER TABLE `biz_main_blueprint` DROP COLUMN `canvasJSON`;
ALTER TABLE `biz_main_blueprint` CHANGE `canvasJSON_tmp` `canvasJSON` longtext NOT NULL COMMENT '画布JSON';
ALTER TABLE `biz_main_blueprint` ADD COLUMN `viewJSON_tmp` longtext NOT NULL COMMENT '视图JSON' AFTER `viewJSON`;
UPDATE `biz_main_blueprint` SET `viewJSON_tmp` = `viewJSON`;
ALTER TABLE `biz_main_blueprint` DROP COLUMN `viewJSON`;
ALTER TABLE `biz_main_blueprint` CHANGE `viewJSON_tmp` `viewJSON` longtext NOT NULL COMMENT '视图JSON';
ALTER TABLE `biz_main_connector` ADD COLUMN `configJSON_tmp` longtext NOT NULL COMMENT '配置JSON' AFTER `configJSON`;
UPDATE `biz_main_connector` SET `configJSON_tmp` = `configJSON`;
ALTER TABLE `biz_main_connector` DROP COLUMN `configJSON`;
ALTER TABLE `biz_main_connector` CHANGE `configJSON_tmp` `configJSON` longtext NOT NULL COMMENT '配置JSON';
ALTER TABLE `biz_main_cron_job` ADD COLUMN `funcCallKwargsJSON_tmp` longtext DEFAULT NULL COMMENT '函数调用参数JSON (kwargs)' AFTER `funcCallKwargsJSON`;
UPDATE `biz_main_cron_job` SET `funcCallKwargsJSON_tmp` = `funcCallKwargsJSON`;
ALTER TABLE `biz_main_cron_job` DROP COLUMN `funcCallKwargsJSON`;
ALTER TABLE `biz_main_cron_job` CHANGE `funcCallKwargsJSON_tmp` `funcCallKwargsJSON` longtext DEFAULT NULL COMMENT '函数调用参数JSON (kwargs)';
ALTER TABLE `biz_main_cron_job` ADD COLUMN `tagsJSON_tmp` longtext DEFAULT NULL COMMENT '标签JSON' AFTER `tagsJSON`;
UPDATE `biz_main_cron_job` SET `tagsJSON_tmp` = `tagsJSON`;
ALTER TABLE `biz_main_cron_job` DROP COLUMN `tagsJSON`;
ALTER TABLE `biz_main_cron_job` CHANGE `tagsJSON_tmp` `tagsJSON` longtext DEFAULT NULL COMMENT '标签JSON';
ALTER TABLE `biz_main_func` ADD COLUMN `argsJSON_tmp` longtext DEFAULT NULL COMMENT '位置参数JSON' AFTER `argsJSON`;
UPDATE `biz_main_func` SET `argsJSON_tmp` = `argsJSON`;
ALTER TABLE `biz_main_func` DROP COLUMN `argsJSON`;
ALTER TABLE `biz_main_func` CHANGE `argsJSON_tmp` `argsJSON` longtext DEFAULT NULL COMMENT '位置参数JSON';
ALTER TABLE `biz_main_func` ADD COLUMN `kwargsJSON_tmp` longtext DEFAULT NULL COMMENT '命名参数JSON' AFTER `kwargsJSON`;
UPDATE `biz_main_func` SET `kwargsJSON_tmp` = `kwargsJSON`;
ALTER TABLE `biz_main_func` DROP COLUMN `kwargsJSON`;
ALTER TABLE `biz_main_func` CHANGE `kwargsJSON_tmp` `kwargsJSON` longtext DEFAULT NULL COMMENT '命名参数JSON';
ALTER TABLE `biz_main_func` ADD COLUMN `extraConfigJSON_tmp` longtext DEFAULT NULL COMMENT '函数额外配置JSON' AFTER `extraConfigJSON`;
UPDATE `biz_main_func` SET `extraConfigJSON_tmp` = `extraConfigJSON`;
ALTER TABLE `biz_main_func` DROP COLUMN `extraConfigJSON`;
ALTER TABLE `biz_main_func` CHANGE `extraConfigJSON_tmp` `extraConfigJSON` longtext DEFAULT NULL COMMENT '函数额外配置JSON';
ALTER TABLE `biz_main_func` ADD COLUMN `tagsJSON_tmp` longtext DEFAULT NULL COMMENT '函数标签JSON' AFTER `tagsJSON`;
UPDATE `biz_main_func` SET `tagsJSON_tmp` = `tagsJSON`;
ALTER TABLE `biz_main_func` DROP COLUMN `tagsJSON`;
ALTER TABLE `biz_main_func` CHANGE `tagsJSON_tmp` `tagsJSON` longtext DEFAULT NULL COMMENT '函数标签JSON';
ALTER TABLE `biz_main_func_store` ADD COLUMN `valueJSON_tmp` longtext NOT NULL COMMENT '值JSON' AFTER `valueJSON`;
UPDATE `biz_main_func_store` SET `valueJSON_tmp` = `valueJSON`;
ALTER TABLE `biz_main_func_store` DROP COLUMN `valueJSON`;
ALTER TABLE `biz_main_func_store` CHANGE `valueJSON_tmp` `valueJSON` longtext NOT NULL COMMENT '值JSON';
ALTER TABLE `biz_main_operation_record` ADD COLUMN `clientIPsJSON_tmp` longtext DEFAULT NULL COMMENT '客户端IP JSON' AFTER `clientIPsJSON`;
UPDATE `biz_main_operation_record` SET `clientIPsJSON_tmp` = `clientIPsJSON`;
ALTER TABLE `biz_main_operation_record` DROP COLUMN `clientIPsJSON`;
ALTER TABLE `biz_main_operation_record` CHANGE `clientIPsJSON_tmp` `clientIPsJSON` longtext DEFAULT NULL COMMENT '客户端IP JSON';
ALTER TABLE `biz_main_operation_record` ADD COLUMN `reqQueryJSON_tmp` longtext DEFAULT NULL COMMENT '请求Query JSON' AFTER `reqQueryJSON`;
UPDATE `biz_main_operation_record` SET `reqQueryJSON_tmp` = `reqQueryJSON`;
ALTER TABLE `biz_main_operation_record` DROP COLUMN `reqQueryJSON`;
ALTER TABLE `biz_main_operation_record` CHANGE `reqQueryJSON_tmp` `reqQueryJSON` longtext DEFAULT NULL COMMENT '请求Query JSON';
ALTER TABLE `biz_main_operation_record` ADD COLUMN `reqParamsJSON_tmp` longtext DEFAULT NULL COMMENT '请求Params JSON' AFTER `reqParamsJSON`;
UPDATE `biz_main_operation_record` SET `reqParamsJSON_tmp` = `reqParamsJSON`;
ALTER TABLE `biz_main_operation_record` DROP COLUMN `reqParamsJSON`;
ALTER TABLE `biz_main_operation_record` CHANGE `reqParamsJSON_tmp` `reqParamsJSON` longtext DEFAULT NULL COMMENT '请求Params JSON';
ALTER TABLE `biz_main_operation_record` ADD COLUMN `reqBodyJSON_tmp` longtext DEFAULT NULL COMMENT '请求体JSON' AFTER `reqBodyJSON`;
UPDATE `biz_main_operation_record` SET `reqBodyJSON_tmp` = `reqBodyJSON`;
ALTER TABLE `biz_main_operation_record` DROP COLUMN `reqBodyJSON`;
ALTER TABLE `biz_main_operation_record` CHANGE `reqBodyJSON_tmp` `reqBodyJSON` longtext DEFAULT NULL COMMENT '请求体JSON';
ALTER TABLE `biz_main_operation_record` ADD COLUMN `reqFileInfoJSON_tmp` longtext DEFAULT NULL COMMENT '上传文件信息JSON' AFTER `reqFileInfoJSON`;
UPDATE `biz_main_operation_record` SET `reqFileInfoJSON_tmp` = `reqFileInfoJSON`;
ALTER TABLE `biz_main_operation_record` DROP COLUMN `reqFileInfoJSON`;
ALTER TABLE `biz_main_operation_record` CHANGE `reqFileInfoJSON_tmp` `reqFileInfoJSON` longtext DEFAULT NULL COMMENT '上传文件信息JSON';
ALTER TABLE `biz_main_operation_record` ADD COLUMN `respBodyJSON_tmp` longtext DEFAULT NULL COMMENT '响应体JSON' AFTER `respBodyJSON`;
UPDATE `biz_main_operation_record` SET `respBodyJSON_tmp` = `respBodyJSON`;
ALTER TABLE `biz_main_operation_record` DROP COLUMN `respBodyJSON`;
ALTER TABLE `biz_main_operation_record` CHANGE `respBodyJSON_tmp` `respBodyJSON` longtext DEFAULT NULL COMMENT '响应体JSON';
ALTER TABLE `biz_main_script_market` ADD COLUMN `configJSON_tmp` longtext DEFAULT NULL COMMENT '配置信息JSON' AFTER `configJSON`;
UPDATE `biz_main_script_market` SET `configJSON_tmp` = `configJSON`;
ALTER TABLE `biz_main_script_market` DROP COLUMN `configJSON`;
ALTER TABLE `biz_main_script_market` CHANGE `configJSON_tmp` `configJSON` longtext DEFAULT NULL COMMENT '配置信息JSON';
ALTER TABLE `biz_main_script_market` ADD COLUMN `extraJSON_tmp` longtext DEFAULT NULL COMMENT '额外信息JSON' AFTER `extraJSON`;
UPDATE `biz_main_script_market` SET `extraJSON_tmp` = `extraJSON`;
ALTER TABLE `biz_main_script_market` DROP COLUMN `extraJSON`;
ALTER TABLE `biz_main_script_market` CHANGE `extraJSON_tmp` `extraJSON` longtext DEFAULT NULL COMMENT '额外信息JSON';
ALTER TABLE `biz_main_script_recover_point` ADD COLUMN `tableDumpJSON_tmp` longtext DEFAULT NULL COMMENT '表备份数据JSON' AFTER `tableDumpJSON`;
UPDATE `biz_main_script_recover_point` SET `tableDumpJSON_tmp` = `tableDumpJSON`;
ALTER TABLE `biz_main_script_recover_point` DROP COLUMN `tableDumpJSON`;
ALTER TABLE `biz_main_script_recover_point` CHANGE `tableDumpJSON_tmp` `tableDumpJSON` longtext DEFAULT NULL COMMENT '表备份数据JSON';
ALTER TABLE `biz_main_script_set_export_history` ADD COLUMN `summaryJSON_tmp` longtext NOT NULL COMMENT '导出摘要JSON' AFTER `summaryJSON`;
UPDATE `biz_main_script_set_export_history` SET `summaryJSON_tmp` = `summaryJSON`;
ALTER TABLE `biz_main_script_set_export_history` DROP COLUMN `summaryJSON`;
ALTER TABLE `biz_main_script_set_export_history` CHANGE `summaryJSON_tmp` `summaryJSON` longtext NOT NULL COMMENT '导出摘要JSON';
ALTER TABLE `biz_main_script_set_import_history` ADD COLUMN `summaryJSON_tmp` longtext NOT NULL COMMENT '导出摘要JSON' AFTER `summaryJSON`;
UPDATE `biz_main_script_set_import_history` SET `summaryJSON_tmp` = `summaryJSON`;
ALTER TABLE `biz_main_script_set_import_history` DROP COLUMN `summaryJSON`;
ALTER TABLE `biz_main_script_set_import_history` CHANGE `summaryJSON_tmp` `summaryJSON` longtext NOT NULL COMMENT '导出摘要JSON';
ALTER TABLE `biz_main_sync_api` ADD COLUMN `funcCallKwargsJSON_tmp` longtext DEFAULT NULL COMMENT '函数调用参数JSON (kwargs)' AFTER `funcCallKwargsJSON`;
UPDATE `biz_main_sync_api` SET `funcCallKwargsJSON_tmp` = `funcCallKwargsJSON`;
ALTER TABLE `biz_main_sync_api` DROP COLUMN `funcCallKwargsJSON`;
ALTER TABLE `biz_main_sync_api` CHANGE `funcCallKwargsJSON_tmp` `funcCallKwargsJSON` longtext DEFAULT NULL COMMENT '函数调用参数JSON (kwargs)';
ALTER TABLE `biz_main_sync_api` ADD COLUMN `tagsJSON_tmp` longtext DEFAULT NULL COMMENT '标签JSON' AFTER `tagsJSON`;
UPDATE `biz_main_sync_api` SET `tagsJSON_tmp` = `tagsJSON`;
ALTER TABLE `biz_main_sync_api` DROP COLUMN `tagsJSON`;
ALTER TABLE `biz_main_sync_api` CHANGE `tagsJSON_tmp` `tagsJSON` longtext DEFAULT NULL COMMENT '标签JSON';
ALTER TABLE `biz_main_sync_api` ADD COLUMN `throttlingJSON_tmp` longtext DEFAULT NULL COMMENT '限流JSON' AFTER `throttlingJSON`;
UPDATE `biz_main_sync_api` SET `throttlingJSON_tmp` = `throttlingJSON`;
ALTER TABLE `biz_main_sync_api` DROP COLUMN `throttlingJSON`;
ALTER TABLE `biz_main_sync_api` CHANGE `throttlingJSON_tmp` `throttlingJSON` longtext DEFAULT NULL COMMENT '限流JSON';
ALTER TABLE `biz_main_task_record` ADD COLUMN `kwargsJSON_tmp` longtext DEFAULT NULL COMMENT '调用参数JSON' AFTER `kwargsJSON`;
UPDATE `biz_main_task_record` SET `kwargsJSON_tmp` = `kwargsJSON`;
ALTER TABLE `biz_main_task_record` DROP COLUMN `kwargsJSON`;
ALTER TABLE `biz_main_task_record` CHANGE `kwargsJSON_tmp` `kwargsJSON` longtext DEFAULT NULL COMMENT '调用参数JSON';
ALTER TABLE `biz_main_task_record` ADD COLUMN `resultJSON_tmp` longtext DEFAULT NULL COMMENT '结果JSON' AFTER `resultJSON`;
UPDATE `biz_main_task_record` SET `resultJSON_tmp` = `resultJSON`;
ALTER TABLE `biz_main_task_record` DROP COLUMN `resultJSON`;
ALTER TABLE `biz_main_task_record` CHANGE `resultJSON_tmp` `resultJSON` longtext DEFAULT NULL COMMENT '结果JSON';
ALTER TABLE `biz_main_task_record_func` ADD COLUMN `funcCallKwargsJSON_tmp` longtext DEFAULT NULL COMMENT '调用参数JSON' AFTER `funcCallKwargsJSON`;
UPDATE `biz_main_task_record_func` SET `funcCallKwargsJSON_tmp` = `funcCallKwargsJSON`;
ALTER TABLE `biz_main_task_record_func` DROP COLUMN `funcCallKwargsJSON`;
ALTER TABLE `biz_main_task_record_func` CHANGE `funcCallKwargsJSON_tmp` `funcCallKwargsJSON` longtext DEFAULT NULL COMMENT '调用参数JSON';
ALTER TABLE `biz_main_task_record_func` ADD COLUMN `callChainJSON_tmp` longtext DEFAULT NULL COMMENT '函数调用链JSON' AFTER `callChainJSON`;
UPDATE `biz_main_task_record_func` SET `callChainJSON_tmp` = `callChainJSON`;
ALTER TABLE `biz_main_task_record_func` DROP COLUMN `callChainJSON`;
ALTER TABLE `biz_main_task_record_func` CHANGE `callChainJSON_tmp` `callChainJSON` longtext DEFAULT NULL COMMENT '函数调用链JSON';
ALTER TABLE `biz_main_task_record_func` ADD COLUMN `returnValueJSON_tmp` longtext DEFAULT NULL COMMENT '返回值JSON' AFTER `returnValueJSON`;
UPDATE `biz_main_task_record_func` SET `returnValueJSON_tmp` = `returnValueJSON`;
ALTER TABLE `biz_main_task_record_func` DROP COLUMN `returnValueJSON`;
ALTER TABLE `biz_main_task_record_func` CHANGE `returnValueJSON_tmp` `returnValueJSON` longtext DEFAULT NULL COMMENT '返回值JSON';
ALTER TABLE `biz_main_task_record_func` ADD COLUMN `responseControlJSON_tmp` longtext DEFAULT NULL COMMENT '响应控制JSON' AFTER `responseControlJSON`;
UPDATE `biz_main_task_record_func` SET `responseControlJSON_tmp` = `responseControlJSON`;
ALTER TABLE `biz_main_task_record_func` DROP COLUMN `responseControlJSON`;
ALTER TABLE `biz_main_task_record_func` CHANGE `responseControlJSON_tmp` `responseControlJSON` longtext DEFAULT NULL COMMENT '响应控制JSON';
-- exceptionType 可以为 NULL
ALTER TABLE `biz_main_task_record` ADD COLUMN `exceptionType_tmp` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '错误类型' AFTER `exceptionType`;
UPDATE `biz_main_task_record` SET `exceptionType_tmp` = `exceptionType`;
ALTER TABLE `biz_main_task_record` DROP COLUMN `exceptionType`;
ALTER TABLE `biz_main_task_record` CHANGE `exceptionType_tmp` `exceptionType` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '错误类型';
ALTER TABLE `biz_main_task_record_func` ADD COLUMN `exceptionType_tmp` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '错误类型' AFTER `exceptionType`;
UPDATE `biz_main_task_record_func` SET `exceptionType_tmp` = `exceptionType`;
ALTER TABLE `biz_main_task_record_func` DROP COLUMN `exceptionType`;
ALTER TABLE `biz_main_task_record_func` CHANGE `exceptionType_tmp` `exceptionType` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '错误类型';
-- 重建部分表索引
ALTER TABLE `biz_main_operation_record`
DROP INDEX `USER_ID`,
DROP INDEX `USERNAME`,
DROP INDEX `CLIENT_ID`,
DROP INDEX `TRACE_ID`,
DROP INDEX `REQ_METHOD`,
DROP INDEX `REQ_ROUTE`;
ALTER TABLE `biz_main_operation_record`
ADD UNIQUE INDEX `ID` (`id`),
ADD INDEX `USER_ID` (`userId`),
ADD INDEX `USERNAME` (`username`),
ADD INDEX `CLIENT_ID` (`clientId`),
ADD INDEX `TRACE_ID` (`traceId`),
ADD INDEX `REQ_METHOD` (`reqMethod`),
ADD INDEX `REQ_ROUTE` (`reqRoute`),
ADD INDEX `CREATE_TIME` (`createTime`);
ALTER TABLE `biz_main_script_recover_point`
ADD UNIQUE INDEX `ID` (`id`);
postgresql: |-
-- 初版
SELECT 'Base PostgreSQL DB';
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/dataflux/dataflux-func.git
git@gitee.com:dataflux/dataflux-func.git
dataflux
dataflux-func
dataflux-func
dev

搜索帮助