-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathupgrade-info.yaml
1543 lines (1346 loc) · 93.4 KB
/
upgrade-info.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# 当前数据库版本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;
# 于观测云 SaaS 2024-11-20 迭代中实装
# 从此版本开始,同时支持 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`;