feat: 跟随mysql更新脚本

This commit is contained in:
dhb52 2024-05-20 22:06:31 +08:00
parent 0f646c7ed2
commit 546e1b2097
3 changed files with 108 additions and 85 deletions

View File

@ -2,7 +2,7 @@
SnailJob Database Transfer Tool
Source Server Type : MySQL
Target Server Type : Oracle
Date: 2024-05-14 23:36:38
Date: 2024-05-20 22:01:56
*/
@ -134,7 +134,7 @@ CREATE INDEX idx_sj_notify_recipient_01 ON sj_notify_recipient (namespace_id);
COMMENT ON COLUMN sj_notify_recipient.id IS '主键';
COMMENT ON COLUMN sj_notify_recipient.namespace_id IS '命名空间id';
COMMENT ON COLUMN sj_notify_recipient.recipient_name IS '接收人名称';
COMMENT ON COLUMN sj_notify_recipient.notify_type IS '通知类型 1、钉钉 2、邮件 3、企业微信 4 飞书';
COMMENT ON COLUMN sj_notify_recipient.notify_type IS '通知类型 1、钉钉 2、邮件 3、企业微信 4 飞书 5 webhook';
COMMENT ON COLUMN sj_notify_recipient.notify_attribute IS '配置属性';
COMMENT ON COLUMN sj_notify_recipient.description IS '描述';
COMMENT ON COLUMN sj_notify_recipient.create_dt IS '创建时间';

View File

@ -2,7 +2,7 @@
SnailJob Database Transfer Tool
Source Server Type : MySQL
Target Server Type : PostgreSQL
Date: 2024-05-13 22:49:34
Date: 2024-05-20 22:02:23
*/
@ -122,7 +122,7 @@ CREATE INDEX idx_sj_notify_recipient_01 ON sj_notify_recipient (namespace_id);
COMMENT ON COLUMN sj_notify_recipient.id IS '主键';
COMMENT ON COLUMN sj_notify_recipient.namespace_id IS '命名空间id';
COMMENT ON COLUMN sj_notify_recipient.recipient_name IS '接收人名称';
COMMENT ON COLUMN sj_notify_recipient.notify_type IS '通知类型 1、钉钉 2、邮件 3、企业微信 4 飞书';
COMMENT ON COLUMN sj_notify_recipient.notify_type IS '通知类型 1、钉钉 2、邮件 3、企业微信 4 飞书 5 webhook';
COMMENT ON COLUMN sj_notify_recipient.notify_attribute IS '配置属性';
COMMENT ON COLUMN sj_notify_recipient.description IS '描述';
COMMENT ON COLUMN sj_notify_recipient.create_dt IS '创建时间';

View File

@ -2,7 +2,7 @@
SnailJob Database Transfer Tool
Source Server Type : MySQL
Target Server Type : Microsoft SQL Server
Date: 2024-05-15 12:54:43
Date: 2024-05-20 22:03:46
*/
@ -17,9 +17,10 @@ CREATE TABLE sj_namespace
create_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP,
update_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP
)
GO
GO
CREATE INDEX idx_sj_namespace_01 ON sj_namespace (name) GO
CREATE INDEX idx_sj_namespace_01 ON sj_namespace (name)
GO
EXEC sp_addextendedproperty
'MS_Description', N'主键',
@ -78,7 +79,7 @@ GO
INSERT INTO sj_namespace (name, unique_id, create_dt, update_dt, deleted)
VALUES (N'Default', N'764d604ec6fc45f68cd92514c40e9e1a', getdate(), getdate(), 0)
GO
GO
-- sj_group_config
CREATE TABLE sj_group_config
@ -97,9 +98,10 @@ CREATE TABLE sj_group_config
create_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP,
update_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP
)
GO
GO
CREATE UNIQUE INDEX uk_sj_group_config_01 ON sj_group_config (namespace_id, group_name) GO
CREATE UNIQUE INDEX uk_sj_group_config_01 ON sj_group_config (namespace_id, group_name)
GO
EXEC sp_addextendedproperty
'MS_Description', N'主键',
@ -216,9 +218,10 @@ CREATE TABLE sj_notify_config
create_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP,
update_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP
)
GO
GO
CREATE INDEX idx_sj_notify_config_01 ON sj_notify_config (namespace_id, group_name, business_id) GO
CREATE INDEX idx_sj_notify_config_01 ON sj_notify_config (namespace_id, group_name, business_id)
GO
EXEC sp_addextendedproperty
'MS_Description', N'主键',
@ -336,9 +339,10 @@ CREATE TABLE sj_notify_recipient
create_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP,
update_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP
)
GO
GO
CREATE INDEX idx_sj_notify_recipient_01 ON sj_notify_recipient (namespace_id) GO
CREATE INDEX idx_sj_notify_recipient_01 ON sj_notify_recipient (namespace_id)
GO
EXEC sp_addextendedproperty
'MS_Description', N'主键',
@ -362,7 +366,7 @@ EXEC sp_addextendedproperty
GO
EXEC sp_addextendedproperty
'MS_Description', N'通知类型 1、钉钉 2、邮件 3、企业微信 4 飞书',
'MS_Description', N'通知类型 1、钉钉 2、邮件 3、企业微信 4 飞书 5 webhook',
'SCHEMA', N'dbo',
'TABLE', N'sj_notify_recipient',
'COLUMN', N'notify_type'
@ -418,18 +422,19 @@ CREATE TABLE sj_retry_dead_letter_0
task_type tinyint NOT NULL DEFAULT 1,
create_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP
)
GO
GO
CREATE UNIQUE INDEX uk_sj_retry_dead_letter_0_01 ON sj_retry_dead_letter_0 (namespace_id, group_name, unique_id)
GO
GO
CREATE INDEX idx_sj_retry_dead_letter_0_01 ON sj_retry_dead_letter_0 (namespace_id, group_name, scene_name)
GO
GO
CREATE INDEX idx_sj_retry_dead_letter_0_02 ON sj_retry_dead_letter_0 (idempotent_id)
GO
GO
CREATE INDEX idx_sj_retry_dead_letter_0_03 ON sj_retry_dead_letter_0 (biz_no)
GO
CREATE INDEX idx_sj_retry_dead_letter_0_04 ON sj_retry_dead_letter_0 (create_dt) GO
GO
CREATE INDEX idx_sj_retry_dead_letter_0_04 ON sj_retry_dead_letter_0 (create_dt)
GO
EXEC sp_addextendedproperty
'MS_Description', N'主键',
@ -541,22 +546,23 @@ CREATE TABLE sj_retry_task_0
create_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP,
update_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP
)
GO
GO
CREATE UNIQUE INDEX uk_sj_retry_task_0_01 ON sj_retry_task_0 (namespace_id, group_name, unique_id)
GO
GO
CREATE INDEX idx_sj_retry_task_0_01 ON sj_retry_task_0 (namespace_id, group_name, scene_name)
GO
GO
CREATE INDEX idx_sj_retry_task_0_02 ON sj_retry_task_0 (namespace_id, group_name, task_type)
GO
GO
CREATE INDEX idx_sj_retry_task_0_03 ON sj_retry_task_0 (namespace_id, group_name, retry_status)
GO
GO
CREATE INDEX idx_sj_retry_task_0_04 ON sj_retry_task_0 (idempotent_id)
GO
GO
CREATE INDEX idx_sj_retry_task_0_05 ON sj_retry_task_0 (biz_no)
GO
CREATE INDEX idx_sj_retry_task_0_06 ON sj_retry_task_0 (create_dt) GO
GO
CREATE INDEX idx_sj_retry_task_0_06 ON sj_retry_task_0 (create_dt)
GO
EXEC sp_addextendedproperty
'MS_Description', N'主键',
@ -694,19 +700,20 @@ CREATE TABLE sj_retry_task_log
create_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP,
update_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP
)
GO
GO
CREATE INDEX idx_sj_retry_task_log_01 ON sj_retry_task_log (namespace_id, group_name, scene_name)
GO
GO
CREATE INDEX idx_sj_retry_task_log_02 ON sj_retry_task_log (retry_status)
GO
GO
CREATE INDEX idx_sj_retry_task_log_03 ON sj_retry_task_log (idempotent_id)
GO
GO
CREATE INDEX idx_sj_retry_task_log_04 ON sj_retry_task_log (unique_id)
GO
GO
CREATE INDEX idx_sj_retry_task_log_05 ON sj_retry_task_log (biz_no)
GO
CREATE INDEX idx_sj_retry_task_log_06 ON sj_retry_task_log (create_dt) GO
GO
CREATE INDEX idx_sj_retry_task_log_06 ON sj_retry_task_log (create_dt)
GO
EXEC sp_addextendedproperty
'MS_Description', N'主键',
@ -824,11 +831,12 @@ CREATE TABLE sj_retry_task_log_message
real_time bigint NOT NULL DEFAULT 0,
create_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP
)
GO
GO
CREATE INDEX idx_sj_retry_task_log_message_01 ON sj_retry_task_log_message (namespace_id, group_name, unique_id)
GO
CREATE INDEX idx_sj_retry_task_log_message_02 ON sj_retry_task_log_message (create_dt) GO
GO
CREATE INDEX idx_sj_retry_task_log_message_02 ON sj_retry_task_log_message (create_dt)
GO
EXEC sp_addextendedproperty
'MS_Description', N'主键',
@ -910,9 +918,10 @@ CREATE TABLE sj_retry_scene_config
create_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP,
update_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP
)
GO
GO
CREATE UNIQUE INDEX uk_sj_retry_scene_config_01 ON sj_retry_scene_config (namespace_id, group_name, scene_name) GO
CREATE UNIQUE INDEX uk_sj_retry_scene_config_01 ON sj_retry_scene_config (namespace_id, group_name, scene_name)
GO
EXEC sp_addextendedproperty
'MS_Description', N'主键',
@ -1033,14 +1042,15 @@ CREATE TABLE sj_server_node
create_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP,
update_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP
)
GO
GO
CREATE UNIQUE INDEX uk_sj_server_node_01 ON sj_server_node (host_id, host_ip)
GO
GO
CREATE INDEX idx_sj_server_node_01 ON sj_server_node (namespace_id, group_name)
GO
CREATE INDEX idx_sj_server_node_02 ON sj_server_node (expire_at, node_type) GO
GO
CREATE INDEX idx_sj_server_node_02 ON sj_server_node (expire_at, node_type)
GO
EXEC sp_addextendedproperty
'MS_Description', N'主键',
@ -1135,7 +1145,8 @@ CREATE TABLE sj_distributed_lock
locked_by nvarchar(255) NOT NULL,
create_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP,
update_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP
) GO
)
GO
EXEC sp_addextendedproperty
'MS_Description', N'主键',
@ -1201,7 +1212,8 @@ CREATE TABLE sj_system_user
role tinyint NOT NULL DEFAULT 0,
create_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP,
update_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP
) GO
)
GO
EXEC sp_addextendedproperty
'MS_Description', N'主键',
@ -1253,7 +1265,7 @@ GO
INSERT INTO sj_system_user (username, password, role)
VALUES (N'admin', N'465c194afb65670f38322df087f0a9bb225cc257e43eb4ac5a0c98ef5b3173ac', 2)
GO
GO
-- sj_system_user_permission
CREATE TABLE sj_system_user_permission
@ -1265,9 +1277,10 @@ CREATE TABLE sj_system_user_permission
create_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP,
update_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP
)
GO
GO
CREATE UNIQUE INDEX uk_sj_system_user_permission_01 ON sj_system_user_permission (namespace_id, group_name, system_user_id) GO
CREATE UNIQUE INDEX uk_sj_system_user_permission_01 ON sj_system_user_permission (namespace_id, group_name, system_user_id)
GO
EXEC sp_addextendedproperty
'MS_Description', N'主键',
@ -1327,9 +1340,10 @@ CREATE TABLE sj_sequence_alloc
step int NOT NULL DEFAULT 100,
update_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP
)
GO
GO
CREATE UNIQUE INDEX uk_sj_sequence_alloc_01 ON sj_sequence_alloc (namespace_id, group_name) GO
CREATE UNIQUE INDEX uk_sj_sequence_alloc_01 ON sj_sequence_alloc (namespace_id, group_name)
GO
EXEC sp_addextendedproperty
'MS_Description', N'主键',
@ -1409,13 +1423,14 @@ CREATE TABLE sj_job
create_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP,
update_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP
)
GO
GO
CREATE INDEX idx_sj_job_01 ON sj_job (namespace_id, group_name)
GO
GO
CREATE INDEX idx_sj_job_02 ON sj_job (job_status, bucket_index)
GO
CREATE INDEX idx_sj_job_03 ON sj_job (create_dt) GO
GO
CREATE INDEX idx_sj_job_03 ON sj_job (create_dt)
GO
EXEC sp_addextendedproperty
'MS_Description', N'主键',
@ -1620,13 +1635,14 @@ CREATE TABLE sj_job_log_message
ext_attrs nvarchar(256) NULL DEFAULT '',
create_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP
)
GO
GO
CREATE INDEX idx_sj_job_log_message_01 ON sj_job_log_message (task_batch_id, task_id)
GO
GO
CREATE INDEX idx_sj_job_log_message_02 ON sj_job_log_message (create_dt)
GO
CREATE INDEX idx_sj_job_log_message_03 ON sj_job_log_message (namespace_id, group_name) GO
GO
CREATE INDEX idx_sj_job_log_message_03 ON sj_job_log_message (namespace_id, group_name)
GO
EXEC sp_addextendedproperty
'MS_Description', N'主键',
@ -1730,13 +1746,14 @@ CREATE TABLE sj_job_task
create_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP,
update_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP
)
GO
GO
CREATE INDEX idx_sj_job_task_01 ON sj_job_task (task_batch_id, task_status)
GO
GO
CREATE INDEX idx_sj_job_task_02 ON sj_job_task (create_dt)
GO
CREATE INDEX idx_sj_job_task_03 ON sj_job_task (namespace_id, group_name) GO
GO
CREATE INDEX idx_sj_job_task_03 ON sj_job_task (namespace_id, group_name)
GO
EXEC sp_addextendedproperty
'MS_Description', N'主键',
@ -1869,15 +1886,16 @@ CREATE TABLE sj_job_task_batch
create_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP,
update_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP
)
GO
GO
CREATE INDEX idx_sj_job_task_batch_01 ON sj_job_task_batch (job_id, task_batch_status)
GO
GO
CREATE INDEX idx_sj_job_task_batch_02 ON sj_job_task_batch (create_dt)
GO
GO
CREATE INDEX idx_sj_job_task_batch_03 ON sj_job_task_batch (namespace_id, group_name)
GO
CREATE INDEX idx_sj_job_task_batch_04 ON sj_job_task_batch (workflow_task_batch_id, workflow_node_id) GO
GO
CREATE INDEX idx_sj_job_task_batch_04 ON sj_job_task_batch (workflow_task_batch_id, workflow_node_id)
GO
EXEC sp_addextendedproperty
'MS_Description', N'主键',
@ -2016,12 +2034,13 @@ CREATE TABLE sj_job_summary
create_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP,
update_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP
)
GO
GO
CREATE UNIQUE INDEX uk_sj_job_summary_01 ON sj_job_summary (trigger_at, system_task_type, business_id)
GO
GO
CREATE INDEX idx_sj_job_summary_01 ON sj_job_summary (namespace_id, group_name, business_id) GO
CREATE INDEX idx_sj_job_summary_01 ON sj_job_summary (namespace_id, group_name, business_id)
GO
EXEC sp_addextendedproperty
'MS_Description', N'主键',
@ -2149,12 +2168,13 @@ CREATE TABLE sj_retry_summary
create_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP,
update_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP
)
GO
GO
CREATE UNIQUE INDEX uk_sj_retry_summary_01 ON sj_retry_summary (namespace_id, group_name, scene_name, trigger_at)
GO
GO
CREATE INDEX idx_sj_retry_summary_01 ON sj_retry_summary (trigger_at) GO
CREATE INDEX idx_sj_retry_summary_01 ON sj_retry_summary (trigger_at)
GO
EXEC sp_addextendedproperty
'MS_Description', N'主键',
@ -2261,11 +2281,12 @@ CREATE TABLE sj_workflow
create_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP,
update_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP
)
GO
GO
CREATE INDEX idx_sj_workflow_01 ON sj_workflow (create_dt)
GO
CREATE INDEX idx_sj_workflow_02 ON sj_workflow (namespace_id, group_name) GO
GO
CREATE INDEX idx_sj_workflow_02 ON sj_workflow (namespace_id, group_name)
GO
EXEC sp_addextendedproperty
'MS_Description', N'主键',
@ -2420,11 +2441,12 @@ CREATE TABLE sj_workflow_node
create_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP,
update_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP
)
GO
GO
CREATE INDEX idx_sj_workflow_node_01 ON sj_workflow_node (create_dt)
GO
CREATE INDEX idx_sj_workflow_node_02 ON sj_workflow_node (namespace_id, group_name) GO
GO
CREATE INDEX idx_sj_workflow_node_02 ON sj_workflow_node (namespace_id, group_name)
GO
EXEC sp_addextendedproperty
'MS_Description', N'主键',
@ -2567,13 +2589,14 @@ CREATE TABLE sj_workflow_task_batch
create_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP,
update_dt datetime2 NOT NULL DEFAULT CURRENT_TIMESTAMP
)
GO
GO
CREATE INDEX idx_sj_workflow_task_batch_01 ON sj_workflow_task_batch (workflow_id, task_batch_status)
GO
GO
CREATE INDEX idx_sj_workflow_task_batch_02 ON sj_workflow_task_batch (create_dt)
GO
CREATE INDEX idx_sj_workflow_task_batch_03 ON sj_workflow_task_batch (namespace_id, group_name) GO
GO
CREATE INDEX idx_sj_workflow_task_batch_03 ON sj_workflow_task_batch (namespace_id, group_name)
GO
EXEC sp_addextendedproperty
'MS_Description', N'主键',