-- ----------------------------
-- Table structure for base_handlername
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[base_handlername]') AND type IN ('U'))
	DROP TABLE [dbo].[base_handlername]
GO

CREATE TABLE [dbo].[base_handlername] (
  [F_Id] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [F_HandlerName] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [F_Executor] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[base_handlername] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'主键',
'SCHEMA', N'dbo',
'TABLE', N'base_handlername',
'COLUMN', N'F_Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'任务名称',
'SCHEMA', N'dbo',
'TABLE', N'base_handlername',
'COLUMN', N'F_HandlerName'
GO

EXEC sp_addextendedproperty
'MS_Description', N'执行器名称',
'SCHEMA', N'dbo',
'TABLE', N'base_handlername',
'COLUMN', N'F_Executor'
GO


-- ----------------------------
-- Records of base_handlername
-- ----------------------------

-- ----------------------------
-- Table structure for base_timetask
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[base_timetask]') AND type IN ('U'))
	DROP TABLE [dbo].[base_timetask]
GO

CREATE TABLE [dbo].[base_timetask] (
  [F_Id] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [F_EnCode] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [F_FullName] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
  [F_ExecuteType] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [F_ExecuteContent] nvarchar(max) COLLATE Chinese_PRC_CI_AS  NULL,
  [F_ExecuteCycleJson] nvarchar(max) COLLATE Chinese_PRC_CI_AS  NULL,
  [F_LastRunTime] datetime  NULL,
  [F_NextRunTime] datetime  NULL,
  [F_RunCount] int  NULL,
  [F_Description] nvarchar(max) COLLATE Chinese_PRC_CI_AS  NULL,
  [F_SortCode] bigint  NULL,
  [F_EnabledMark] int  NULL,
  [F_CreatorTime] datetime  NULL,
  [F_CreatorUserId] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [F_LastModifyTime] datetime  NULL,
  [F_LastModifyUserId] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [F_DeleteMark] int  NULL,
  [F_DeleteTime] datetime  NULL,
  [F_DeleteUserId] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [F_ExecutorName] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [F_TenantId] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[base_timetask] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'自然主键',
'SCHEMA', N'dbo',
'TABLE', N'base_timetask',
'COLUMN', N'F_Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'任务编码',
'SCHEMA', N'dbo',
'TABLE', N'base_timetask',
'COLUMN', N'F_EnCode'
GO

EXEC sp_addextendedproperty
'MS_Description', N'任务名称',
'SCHEMA', N'dbo',
'TABLE', N'base_timetask',
'COLUMN', N'F_FullName'
GO

EXEC sp_addextendedproperty
'MS_Description', N'执行类型',
'SCHEMA', N'dbo',
'TABLE', N'base_timetask',
'COLUMN', N'F_ExecuteType'
GO

EXEC sp_addextendedproperty
'MS_Description', N'执行内容',
'SCHEMA', N'dbo',
'TABLE', N'base_timetask',
'COLUMN', N'F_ExecuteContent'
GO

EXEC sp_addextendedproperty
'MS_Description', N'执行周期',
'SCHEMA', N'dbo',
'TABLE', N'base_timetask',
'COLUMN', N'F_ExecuteCycleJson'
GO

EXEC sp_addextendedproperty
'MS_Description', N'最后运行时间',
'SCHEMA', N'dbo',
'TABLE', N'base_timetask',
'COLUMN', N'F_LastRunTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'下次运行时间',
'SCHEMA', N'dbo',
'TABLE', N'base_timetask',
'COLUMN', N'F_NextRunTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'运行次数',
'SCHEMA', N'dbo',
'TABLE', N'base_timetask',
'COLUMN', N'F_RunCount'
GO

EXEC sp_addextendedproperty
'MS_Description', N'描述',
'SCHEMA', N'dbo',
'TABLE', N'base_timetask',
'COLUMN', N'F_Description'
GO

EXEC sp_addextendedproperty
'MS_Description', N'排序',
'SCHEMA', N'dbo',
'TABLE', N'base_timetask',
'COLUMN', N'F_SortCode'
GO

EXEC sp_addextendedproperty
'MS_Description', N'有效标志',
'SCHEMA', N'dbo',
'TABLE', N'base_timetask',
'COLUMN', N'F_EnabledMark'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'base_timetask',
'COLUMN', N'F_CreatorTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建用户',
'SCHEMA', N'dbo',
'TABLE', N'base_timetask',
'COLUMN', N'F_CreatorUserId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'base_timetask',
'COLUMN', N'F_LastModifyTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改用户',
'SCHEMA', N'dbo',
'TABLE', N'base_timetask',
'COLUMN', N'F_LastModifyUserId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'删除标志',
'SCHEMA', N'dbo',
'TABLE', N'base_timetask',
'COLUMN', N'F_DeleteMark'
GO

EXEC sp_addextendedproperty
'MS_Description', N'删除时间',
'SCHEMA', N'dbo',
'TABLE', N'base_timetask',
'COLUMN', N'F_DeleteTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'删除用户',
'SCHEMA', N'dbo',
'TABLE', N'base_timetask',
'COLUMN', N'F_DeleteUserId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'执行器名称',
'SCHEMA', N'dbo',
'TABLE', N'base_timetask',
'COLUMN', N'F_ExecutorName'
GO

EXEC sp_addextendedproperty
'MS_Description', N'租户id',
'SCHEMA', N'dbo',
'TABLE', N'base_timetask',
'COLUMN', N'F_TenantId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'定时任务',
'SCHEMA', N'dbo',
'TABLE', N'base_timetask'
GO


-- ----------------------------
-- Records of base_timetask
-- ----------------------------

-- ----------------------------
-- Table structure for base_timetasklog
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[base_timetasklog]') AND type IN ('U'))
	DROP TABLE [dbo].[base_timetasklog]
GO

CREATE TABLE [dbo].[base_timetasklog] (
  [F_Id] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [F_TaskId] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [F_RunTime] datetime  NULL,
  [F_RunResult] int  NULL,
  [F_Description] nvarchar(max) COLLATE Chinese_PRC_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[base_timetasklog] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'自然主键',
'SCHEMA', N'dbo',
'TABLE', N'base_timetasklog',
'COLUMN', N'F_Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'定时任务主键',
'SCHEMA', N'dbo',
'TABLE', N'base_timetasklog',
'COLUMN', N'F_TaskId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'执行时间',
'SCHEMA', N'dbo',
'TABLE', N'base_timetasklog',
'COLUMN', N'F_RunTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'执行结果',
'SCHEMA', N'dbo',
'TABLE', N'base_timetasklog',
'COLUMN', N'F_RunResult'
GO

EXEC sp_addextendedproperty
'MS_Description', N'执行说明',
'SCHEMA', N'dbo',
'TABLE', N'base_timetasklog',
'COLUMN', N'F_Description'
GO

EXEC sp_addextendedproperty
'MS_Description', N'定时任务记录',
'SCHEMA', N'dbo',
'TABLE', N'base_timetasklog'
GO


-- ----------------------------
-- Records of base_timetasklog
-- ----------------------------

-- ----------------------------
-- Table structure for xxl_job_group
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[xxl_job_group]') AND type IN ('U'))
	DROP TABLE [dbo].[xxl_job_group]
GO

CREATE TABLE [dbo].[xxl_job_group] (
  [id] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [app_name] nvarchar(64) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [title] nvarchar(64) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [address_type] tinyint  NOT NULL,
  [address_list] nvarchar(max) COLLATE Chinese_PRC_CI_AS  NULL,
  [update_time] datetime  NULL
)
GO

ALTER TABLE [dbo].[xxl_job_group] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'执行器AppName',
'SCHEMA', N'dbo',
'TABLE', N'xxl_job_group',
'COLUMN', N'app_name'
GO

EXEC sp_addextendedproperty
'MS_Description', N'执行器名称',
'SCHEMA', N'dbo',
'TABLE', N'xxl_job_group',
'COLUMN', N'title'
GO

EXEC sp_addextendedproperty
'MS_Description', N'执行器地址类型：0=自动注册、1=手动录入',
'SCHEMA', N'dbo',
'TABLE', N'xxl_job_group',
'COLUMN', N'address_type'
GO

EXEC sp_addextendedproperty
'MS_Description', N'执行器地址列表，多地址逗号分隔',
'SCHEMA', N'dbo',
'TABLE', N'xxl_job_group',
'COLUMN', N'address_list'
GO


-- ----------------------------
-- Records of xxl_job_group
-- ----------------------------
INSERT INTO [dbo].[xxl_job_group] ([id], [app_name], [title], [address_type], [address_list], [update_time]) VALUES (N'8', N'xxl-job-executor-sample1', N'xxl-job-executor-sample1', N'0', N'http://192.168.20.116:9999/', N'2022-12-12 15:35:37')
GO


-- ----------------------------
-- Table structure for xxl_job_info
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[xxl_job_info]') AND type IN ('U'))
	DROP TABLE [dbo].[xxl_job_info]
GO

CREATE TABLE [dbo].[xxl_job_info] (
  [id] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [job_group] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [job_desc] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [add_time] datetime  NULL,
  [update_time] datetime  NULL,
  [author] nvarchar(64) COLLATE Chinese_PRC_CI_AS  NULL,
  [alarm_email] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
  [schedule_type] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [schedule_conf] nvarchar(128) COLLATE Chinese_PRC_CI_AS  NULL,
  [misfire_strategy] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [executor_route_strategy] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [executor_handler] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
  [executor_param] nvarchar(max) COLLATE Chinese_PRC_CI_AS  NULL,
  [executor_block_strategy] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [executor_timeout] int  NOT NULL,
  [executor_fail_retry_count] int  NOT NULL,
  [glue_type] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [glue_source] nvarchar(max) COLLATE Chinese_PRC_CI_AS  NULL,
  [glue_remark] nvarchar(128) COLLATE Chinese_PRC_CI_AS  NULL,
  [glue_updatetime] datetime  NULL,
  [child_jobid] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
  [trigger_status] tinyint  NOT NULL,
  [trigger_last_time] bigint  NOT NULL,
  [trigger_next_time] bigint  NOT NULL,
  [tenantId] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [taskId] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[xxl_job_info] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'执行器主键ID',
'SCHEMA', N'dbo',
'TABLE', N'xxl_job_info',
'COLUMN', N'job_group'
GO

EXEC sp_addextendedproperty
'MS_Description', N'作者',
'SCHEMA', N'dbo',
'TABLE', N'xxl_job_info',
'COLUMN', N'author'
GO

EXEC sp_addextendedproperty
'MS_Description', N'报警邮件',
'SCHEMA', N'dbo',
'TABLE', N'xxl_job_info',
'COLUMN', N'alarm_email'
GO

EXEC sp_addextendedproperty
'MS_Description', N'调度类型',
'SCHEMA', N'dbo',
'TABLE', N'xxl_job_info',
'COLUMN', N'schedule_type'
GO

EXEC sp_addextendedproperty
'MS_Description', N'调度配置，值含义取决于调度类型',
'SCHEMA', N'dbo',
'TABLE', N'xxl_job_info',
'COLUMN', N'schedule_conf'
GO

EXEC sp_addextendedproperty
'MS_Description', N'调度过期策略',
'SCHEMA', N'dbo',
'TABLE', N'xxl_job_info',
'COLUMN', N'misfire_strategy'
GO

EXEC sp_addextendedproperty
'MS_Description', N'执行器路由策略',
'SCHEMA', N'dbo',
'TABLE', N'xxl_job_info',
'COLUMN', N'executor_route_strategy'
GO

EXEC sp_addextendedproperty
'MS_Description', N'执行器任务handler',
'SCHEMA', N'dbo',
'TABLE', N'xxl_job_info',
'COLUMN', N'executor_handler'
GO

EXEC sp_addextendedproperty
'MS_Description', N'执行器任务参数',
'SCHEMA', N'dbo',
'TABLE', N'xxl_job_info',
'COLUMN', N'executor_param'
GO

EXEC sp_addextendedproperty
'MS_Description', N'阻塞处理策略',
'SCHEMA', N'dbo',
'TABLE', N'xxl_job_info',
'COLUMN', N'executor_block_strategy'
GO

EXEC sp_addextendedproperty
'MS_Description', N'任务执行超时时间，单位秒',
'SCHEMA', N'dbo',
'TABLE', N'xxl_job_info',
'COLUMN', N'executor_timeout'
GO

EXEC sp_addextendedproperty
'MS_Description', N'失败重试次数',
'SCHEMA', N'dbo',
'TABLE', N'xxl_job_info',
'COLUMN', N'executor_fail_retry_count'
GO

EXEC sp_addextendedproperty
'MS_Description', N'GLUE类型',
'SCHEMA', N'dbo',
'TABLE', N'xxl_job_info',
'COLUMN', N'glue_type'
GO

EXEC sp_addextendedproperty
'MS_Description', N'GLUE源代码',
'SCHEMA', N'dbo',
'TABLE', N'xxl_job_info',
'COLUMN', N'glue_source'
GO

EXEC sp_addextendedproperty
'MS_Description', N'GLUE备注',
'SCHEMA', N'dbo',
'TABLE', N'xxl_job_info',
'COLUMN', N'glue_remark'
GO

EXEC sp_addextendedproperty
'MS_Description', N'GLUE更新时间',
'SCHEMA', N'dbo',
'TABLE', N'xxl_job_info',
'COLUMN', N'glue_updatetime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'子任务ID，多个逗号分隔',
'SCHEMA', N'dbo',
'TABLE', N'xxl_job_info',
'COLUMN', N'child_jobid'
GO

EXEC sp_addextendedproperty
'MS_Description', N'调度状态：0-停止，1-运行',
'SCHEMA', N'dbo',
'TABLE', N'xxl_job_info',
'COLUMN', N'trigger_status'
GO

EXEC sp_addextendedproperty
'MS_Description', N'上次调度时间',
'SCHEMA', N'dbo',
'TABLE', N'xxl_job_info',
'COLUMN', N'trigger_last_time'
GO

EXEC sp_addextendedproperty
'MS_Description', N'下次调度时间',
'SCHEMA', N'dbo',
'TABLE', N'xxl_job_info',
'COLUMN', N'trigger_next_time'
GO

EXEC sp_addextendedproperty
'MS_Description', N'租户编码',
'SCHEMA', N'dbo',
'TABLE', N'xxl_job_info',
'COLUMN', N'tenantId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'任务id',
'SCHEMA', N'dbo',
'TABLE', N'xxl_job_info',
'COLUMN', N'taskId'
GO


-- ----------------------------
-- Records of xxl_job_info
-- ----------------------------

-- ----------------------------
-- Table structure for xxl_job_lock
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[xxl_job_lock]') AND type IN ('U'))
	DROP TABLE [dbo].[xxl_job_lock]
GO

CREATE TABLE [dbo].[xxl_job_lock] (
  [lock_name] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NOT NULL
)
GO

ALTER TABLE [dbo].[xxl_job_lock] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'锁名称',
'SCHEMA', N'dbo',
'TABLE', N'xxl_job_lock',
'COLUMN', N'lock_name'
GO


-- ----------------------------
-- Records of xxl_job_lock
-- ----------------------------
INSERT INTO [dbo].[xxl_job_lock] ([lock_name]) VALUES (N'schedule_lock')
GO


-- ----------------------------
-- Table structure for xxl_job_log
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[xxl_job_log]') AND type IN ('U'))
	DROP TABLE [dbo].[xxl_job_log]
GO

CREATE TABLE [dbo].[xxl_job_log] (
  [id] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [job_group] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [job_id] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [executor_address] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
  [executor_handler] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
  [executor_param] nvarchar(max) COLLATE Chinese_PRC_CI_AS  NULL,
  [executor_sharding_param] nvarchar(20) COLLATE Chinese_PRC_CI_AS  NULL,
  [executor_fail_retry_count] int  NOT NULL,
  [trigger_time] datetime  NULL,
  [trigger_code] int  NOT NULL,
  [trigger_msg] nvarchar(max) COLLATE Chinese_PRC_CI_AS  NULL,
  [handle_time] datetime  NULL,
  [handle_code] int  NOT NULL,
  [handle_msg] nvarchar(max) COLLATE Chinese_PRC_CI_AS  NULL,
  [alarm_status] tinyint  NOT NULL
)
GO

ALTER TABLE [dbo].[xxl_job_log] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'执行器主键ID',
'SCHEMA', N'dbo',
'TABLE', N'xxl_job_log',
'COLUMN', N'job_group'
GO

EXEC sp_addextendedproperty
'MS_Description', N'任务，主键ID',
'SCHEMA', N'dbo',
'TABLE', N'xxl_job_log',
'COLUMN', N'job_id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'执行器地址，本次执行的地址',
'SCHEMA', N'dbo',
'TABLE', N'xxl_job_log',
'COLUMN', N'executor_address'
GO

EXEC sp_addextendedproperty
'MS_Description', N'执行器任务handler',
'SCHEMA', N'dbo',
'TABLE', N'xxl_job_log',
'COLUMN', N'executor_handler'
GO

EXEC sp_addextendedproperty
'MS_Description', N'执行器任务参数',
'SCHEMA', N'dbo',
'TABLE', N'xxl_job_log',
'COLUMN', N'executor_param'
GO

EXEC sp_addextendedproperty
'MS_Description', N'执行器任务分片参数，格式如 1/2',
'SCHEMA', N'dbo',
'TABLE', N'xxl_job_log',
'COLUMN', N'executor_sharding_param'
GO

EXEC sp_addextendedproperty
'MS_Description', N'失败重试次数',
'SCHEMA', N'dbo',
'TABLE', N'xxl_job_log',
'COLUMN', N'executor_fail_retry_count'
GO

EXEC sp_addextendedproperty
'MS_Description', N'调度-时间',
'SCHEMA', N'dbo',
'TABLE', N'xxl_job_log',
'COLUMN', N'trigger_time'
GO

EXEC sp_addextendedproperty
'MS_Description', N'调度-结果',
'SCHEMA', N'dbo',
'TABLE', N'xxl_job_log',
'COLUMN', N'trigger_code'
GO

EXEC sp_addextendedproperty
'MS_Description', N'调度-日志',
'SCHEMA', N'dbo',
'TABLE', N'xxl_job_log',
'COLUMN', N'trigger_msg'
GO

EXEC sp_addextendedproperty
'MS_Description', N'执行-时间',
'SCHEMA', N'dbo',
'TABLE', N'xxl_job_log',
'COLUMN', N'handle_time'
GO

EXEC sp_addextendedproperty
'MS_Description', N'执行-状态',
'SCHEMA', N'dbo',
'TABLE', N'xxl_job_log',
'COLUMN', N'handle_code'
GO

EXEC sp_addextendedproperty
'MS_Description', N'执行-日志',
'SCHEMA', N'dbo',
'TABLE', N'xxl_job_log',
'COLUMN', N'handle_msg'
GO

EXEC sp_addextendedproperty
'MS_Description', N'告警状态：0-默认、1-无需告警、2-告警成功、3-告警失败',
'SCHEMA', N'dbo',
'TABLE', N'xxl_job_log',
'COLUMN', N'alarm_status'
GO


-- ----------------------------
-- Records of xxl_job_log
-- ----------------------------

-- ----------------------------
-- Table structure for xxl_job_log_report
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[xxl_job_log_report]') AND type IN ('U'))
	DROP TABLE [dbo].[xxl_job_log_report]
GO

CREATE TABLE [dbo].[xxl_job_log_report] (
  [id] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [trigger_day] datetime  NULL,
  [running_count] int  NOT NULL,
  [suc_count] int  NOT NULL,
  [fail_count] int  NOT NULL,
  [update_time] datetime  NULL
)
GO

ALTER TABLE [dbo].[xxl_job_log_report] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'调度-时间',
'SCHEMA', N'dbo',
'TABLE', N'xxl_job_log_report',
'COLUMN', N'trigger_day'
GO

EXEC sp_addextendedproperty
'MS_Description', N'运行中-日志数量',
'SCHEMA', N'dbo',
'TABLE', N'xxl_job_log_report',
'COLUMN', N'running_count'
GO

EXEC sp_addextendedproperty
'MS_Description', N'执行成功-日志数量',
'SCHEMA', N'dbo',
'TABLE', N'xxl_job_log_report',
'COLUMN', N'suc_count'
GO

EXEC sp_addextendedproperty
'MS_Description', N'执行失败-日志数量',
'SCHEMA', N'dbo',
'TABLE', N'xxl_job_log_report',
'COLUMN', N'fail_count'
GO


-- ----------------------------
-- Records of xxl_job_log_report
-- ----------------------------
INSERT INTO [dbo].[xxl_job_log_report] ([id], [trigger_day], [running_count], [suc_count], [fail_count], [update_time]) VALUES (N'1602187341432389633', N'2022-12-12 00:00:00', N'0', N'0', N'0', NULL)
GO

INSERT INTO [dbo].[xxl_job_log_report] ([id], [trigger_day], [running_count], [suc_count], [fail_count], [update_time]) VALUES (N'1602187341746962434', N'2022-12-11 00:00:00', N'0', N'0', N'0', NULL)
GO

INSERT INTO [dbo].[xxl_job_log_report] ([id], [trigger_day], [running_count], [suc_count], [fail_count], [update_time]) VALUES (N'1602187342342553602', N'2022-12-10 00:00:00', N'0', N'0', N'0', NULL)
GO


-- ----------------------------
-- Table structure for xxl_job_logglue
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[xxl_job_logglue]') AND type IN ('U'))
	DROP TABLE [dbo].[xxl_job_logglue]
GO

CREATE TABLE [dbo].[xxl_job_logglue] (
  [id] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [job_id] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [glue_type] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [glue_source] nvarchar(max) COLLATE Chinese_PRC_CI_AS  NULL,
  [glue_remark] nvarchar(128) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [add_time] datetime  NULL,
  [update_time] datetime  NULL
)
GO

ALTER TABLE [dbo].[xxl_job_logglue] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'任务，主键ID',
'SCHEMA', N'dbo',
'TABLE', N'xxl_job_logglue',
'COLUMN', N'job_id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'GLUE类型',
'SCHEMA', N'dbo',
'TABLE', N'xxl_job_logglue',
'COLUMN', N'glue_type'
GO

EXEC sp_addextendedproperty
'MS_Description', N'GLUE源代码',
'SCHEMA', N'dbo',
'TABLE', N'xxl_job_logglue',
'COLUMN', N'glue_source'
GO

EXEC sp_addextendedproperty
'MS_Description', N'GLUE备注',
'SCHEMA', N'dbo',
'TABLE', N'xxl_job_logglue',
'COLUMN', N'glue_remark'
GO


-- ----------------------------
-- Records of xxl_job_logglue
-- ----------------------------

-- ----------------------------
-- Table structure for xxl_job_registry
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[xxl_job_registry]') AND type IN ('U'))
	DROP TABLE [dbo].[xxl_job_registry]
GO

CREATE TABLE [dbo].[xxl_job_registry] (
  [id] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [registry_group] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [registry_key] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [registry_value] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [update_time] datetime  NULL
)
GO

ALTER TABLE [dbo].[xxl_job_registry] SET (LOCK_ESCALATION = TABLE)
GO


-- ----------------------------
-- Records of xxl_job_registry
-- ----------------------------

-- ----------------------------
-- Table structure for xxl_job_user
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[xxl_job_user]') AND type IN ('U'))
	DROP TABLE [dbo].[xxl_job_user]
GO

CREATE TABLE [dbo].[xxl_job_user] (
  [id] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [username] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [password] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [role] tinyint  NOT NULL,
  [permission] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[xxl_job_user] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'账号',
'SCHEMA', N'dbo',
'TABLE', N'xxl_job_user',
'COLUMN', N'username'
GO

EXEC sp_addextendedproperty
'MS_Description', N'密码',
'SCHEMA', N'dbo',
'TABLE', N'xxl_job_user',
'COLUMN', N'password'
GO

EXEC sp_addextendedproperty
'MS_Description', N'角色：0-普通用户、1-管理员',
'SCHEMA', N'dbo',
'TABLE', N'xxl_job_user',
'COLUMN', N'role'
GO

EXEC sp_addextendedproperty
'MS_Description', N'权限：执行器ID列表，多个逗号分割',
'SCHEMA', N'dbo',
'TABLE', N'xxl_job_user',
'COLUMN', N'permission'
GO


-- ----------------------------
-- Records of xxl_job_user
-- ----------------------------
INSERT INTO [dbo].[xxl_job_user] ([id], [username], [password], [role], [permission]) VALUES (N'1', N'admin', N'e10adc3949ba59abbe56e057f20f883e', N'1', NULL)
GO


-- ----------------------------
-- Primary Key structure for table base_handlername
-- ----------------------------
ALTER TABLE [dbo].[base_handlername] ADD CONSTRAINT [PK__base_han__2C6EC7231A712B29] PRIMARY KEY CLUSTERED ([F_Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table base_timetask
-- ----------------------------
ALTER TABLE [dbo].[base_timetask] ADD CONSTRAINT [PK__base_tim__2C6EC723059944A9] PRIMARY KEY CLUSTERED ([F_Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table base_timetasklog
-- ----------------------------
ALTER TABLE [dbo].[base_timetasklog] ADD CONSTRAINT [PK__base_tim__2C6EC72317A1B4F9] PRIMARY KEY CLUSTERED ([F_Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table xxl_job_group
-- ----------------------------
ALTER TABLE [dbo].[xxl_job_group] ADD CONSTRAINT [PK__xxl_job___3213E83FF127DBC2] PRIMARY KEY CLUSTERED ([id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table xxl_job_info
-- ----------------------------
ALTER TABLE [dbo].[xxl_job_info] ADD CONSTRAINT [PK__xxl_job___3213E83FC3E92D83] PRIMARY KEY CLUSTERED ([id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table xxl_job_lock
-- ----------------------------
ALTER TABLE [dbo].[xxl_job_lock] ADD CONSTRAINT [PK__xxl_job___7BE7AEAB5CE868F7] PRIMARY KEY CLUSTERED ([lock_name])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Indexes structure for table xxl_job_log
-- ----------------------------
CREATE NONCLUSTERED INDEX [I_trigger_time]
ON [dbo].[xxl_job_log] (
  [trigger_time] ASC
)
GO

CREATE NONCLUSTERED INDEX [I_handle_code]
ON [dbo].[xxl_job_log] (
  [handle_code] ASC
)
GO

CREATE NONCLUSTERED INDEX [I_job_id]
ON [dbo].[xxl_job_log] (
  [job_id] ASC,
  [trigger_time] ASC
)
GO


-- ----------------------------
-- Primary Key structure for table xxl_job_log
-- ----------------------------
ALTER TABLE [dbo].[xxl_job_log] ADD CONSTRAINT [PK__xxl_job___3213E83FBE4F2C1D] PRIMARY KEY CLUSTERED ([id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Indexes structure for table xxl_job_log_report
-- ----------------------------
CREATE UNIQUE NONCLUSTERED INDEX [i_trigger_day]
ON [dbo].[xxl_job_log_report] (
  [trigger_day] ASC
)
GO


-- ----------------------------
-- Primary Key structure for table xxl_job_log_report
-- ----------------------------
ALTER TABLE [dbo].[xxl_job_log_report] ADD CONSTRAINT [PK__xxl_job___3213E83FF8C8F0E0] PRIMARY KEY CLUSTERED ([id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table xxl_job_logglue
-- ----------------------------
ALTER TABLE [dbo].[xxl_job_logglue] ADD CONSTRAINT [PK__xxl_job___3213E83FB1FFEB48] PRIMARY KEY CLUSTERED ([id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Indexes structure for table xxl_job_registry
-- ----------------------------
CREATE NONCLUSTERED INDEX [i_g_k_v]
ON [dbo].[xxl_job_registry] (
  [registry_group] ASC,
  [registry_key] ASC,
  [registry_value] ASC
)
GO


-- ----------------------------
-- Primary Key structure for table xxl_job_registry
-- ----------------------------
ALTER TABLE [dbo].[xxl_job_registry] ADD CONSTRAINT [PK__xxl_job___3213E83F6EB65FEF] PRIMARY KEY CLUSTERED ([id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Indexes structure for table xxl_job_user
-- ----------------------------
CREATE UNIQUE NONCLUSTERED INDEX [i_username]
ON [dbo].[xxl_job_user] (
  [username] ASC
)
GO


-- ----------------------------
-- Primary Key structure for table xxl_job_user
-- ----------------------------
ALTER TABLE [dbo].[xxl_job_user] ADD CONSTRAINT [PK__xxl_job___3213E83F42BE27C5] PRIMARY KEY CLUSTERED ([id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO

