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

CREATE TABLE [dbo].[ck_alarm_config] (
    [SID] bigint  NOT NULL,
    [ALARM_NAME] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [THRESHOLD_TYPE] nchar(1) COLLATE Chinese_PRC_CI_AS  NULL,
    [THRESHOLD_RELATION] nvarchar(64) COLLATE Chinese_PRC_CI_AS  NULL,
    [THRESHOLD_VALUE] nvarchar(10) COLLATE Chinese_PRC_CI_AS  NULL,
    [ALARM_LEVEL] nchar(1) COLLATE Chinese_PRC_CI_AS  NULL,
    [STATE] nchar(1) COLLATE Chinese_PRC_CI_AS  NULL,
    [DELETED] nchar(1) COLLATE Chinese_PRC_CI_AS  NOT NULL,
    [CREATE_BY] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NOT NULL,
    [CREATE_TIME] datetime2(7)  NOT NULL,
    [UPDATE_BY] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [UPDATE_TIME] datetime2(7)  NULL,
    [REMARK] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [messagetype] int  NULL,
    [STANDBY] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL
    )
    GO

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

    EXEC sp_addextendedproperty
    'MS_Description', N'1、数值 2、百分比',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_alarm_config',
    'COLUMN', N'THRESHOLD_TYPE'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'gt代表> eq代表= lt代表<',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_alarm_config',
    'COLUMN', N'THRESHOLD_RELATION'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'1、一般 2、中等 3、严重',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_alarm_config',
    'COLUMN', N'ALARM_LEVEL'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'1、新增 2、生效 3、挂起',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_alarm_config',
    'COLUMN', N'STATE'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'CK_ALARM_CONFIG',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_alarm_config'
    GO


    -- ----------------------------
-- Records of ck_alarm_config
-- ----------------------------

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

CREATE TABLE [dbo].[ck_alarm_record] (
    [SID] bigint  NOT NULL,
    [RELATION_ID] bigint  NULL,
    [RELATION_TABLE] nvarchar(10) COLLATE Chinese_PRC_CI_AS  NULL,
    [ALARM_SID] bigint  NULL,
    [CHECK_LOG_SID] bigint  NULL,
    [CONTENT] nvarchar(1000) COLLATE Chinese_PRC_CI_AS  NULL,
    [message_send_result] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [RECEIVED_BY] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [RECEIPT_TIME] datetime2(7)  NULL,
    [STATE] nchar(1) COLLATE Chinese_PRC_CI_AS  NULL,
    [DELETED] nchar(1) COLLATE Chinese_PRC_CI_AS  NULL,
    [CREATE_BY] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [CREATE_TIME] datetime2(7)  NULL,
    [UPDATE_BY] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [UPDATE_TIME] datetime2(7)  NULL
    )
    GO

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

    EXEC sp_addextendedproperty
    'MS_Description', N'TABLE:表检核、ITEM:nosql检核、COMMON:通用检核',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_alarm_record',
    'COLUMN', N'RELATION_TABLE'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'CK_ALARM_CONFIG SID',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_alarm_record',
    'COLUMN', N'ALARM_SID'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'CK_CHECK_LOG SID',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_alarm_record',
    'COLUMN', N'CHECK_LOG_SID'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'提醒、不再提醒',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_alarm_record',
    'COLUMN', N'STATE'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'1删除，0不删除（默认0）',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_alarm_record',
    'COLUMN', N'DELETED'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'告警记录表',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_alarm_record'
    GO


    -- ----------------------------
-- Records of ck_alarm_record
-- ----------------------------

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

CREATE TABLE [dbo].[ck_calendar] (
    [CK_ID] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NOT NULL,
    [CK_NAME] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NOT NULL,
    [CK_DESC] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [CK_YEAR] int  NOT NULL,
    [CK_DATELIST] nvarchar(max) COLLATE Chinese_PRC_CI_AS  NOT NULL,
    [CREATE_BY] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [CREATE_TIME] datetime2(7)  NULL,
    [UPDATE_BY] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [UPDATE_TIME] datetime2(7)  NULL
    )
    GO

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


    -- ----------------------------
-- Records of ck_calendar
-- ----------------------------

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

CREATE TABLE [dbo].[ck_check_log] (
    [SID] bigint  NOT NULL,
    [METHOD_CONFIG_ID] bigint  NULL,
    [CHECK_TIME] datetime2(7)  NULL,
    [CHECK_END_TIME] datetime2(7)  NULL,
    [CHECK_DURATION] nvarchar(10) COLLATE Chinese_PRC_CI_AS  NULL,
    [JOB_ID] bigint  NULL,
    [JOB_LOG_ID] bigint  NULL,
    [CHECK_STATUS] nvarchar(10) COLLATE Chinese_PRC_CI_AS  NULL,
    [RESULT_ID] nvarchar(64) COLLATE Chinese_PRC_CI_AS  NULL,
    [ERROR_REMARK] nvarchar(max) COLLATE Chinese_PRC_CI_AS  NULL
    )
    GO

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


    -- ----------------------------
-- Records of ck_check_log
-- ----------------------------

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

CREATE TABLE [dbo].[ck_check_log_latest] (
    [METHOD_CONFIG_ID] bigint  NOT NULL,
[LOG_SID] bigint  NULL
)
    GO

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


    -- ----------------------------
-- Records of ck_check_log_latest
-- ----------------------------

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

CREATE TABLE [dbo].[ck_check_result] (
    [SID] bigint  NOT NULL,
    [INDEX_SID] bigint  NULL,
    [CHECK_FREQUENCY] nvarchar(5) COLLATE Chinese_PRC_CI_AS  NULL,
    [CHECK_TIME] datetime2(7)  NULL,
    [CHECK_END_TIME] datetime2(7)  NULL,
    [CHECK_DURATION] nvarchar(10) COLLATE Chinese_PRC_CI_AS  NULL,
    [ERROR_NUM] bigint  NULL,
    [SUM_NUM] bigint  NULL,
    [RESOURCE_SID] bigint  NULL,
    [ITEM_SID] bigint  NULL,
    [ERROR_KEYWORD] nvarchar(max) COLLATE Chinese_PRC_CI_AS  NULL,
    [ERROR_VALUE] nvarchar(max) COLLATE Chinese_PRC_CI_AS  NULL,
    [ERROR_REMARK] nvarchar(max) COLLATE Chinese_PRC_CI_AS  NULL,
    [SOURCE_DATE] datetime2(7)  NULL,
    [ERROR_SOURCE1] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
    [ERROR_SOURCE2] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
    [ERROR_SOURCE3] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
    [METHOD_CONFIG_ID] bigint  NOT NULL,
    [JOB_ID] bigint  NULL,
    [JOB_LOG_ID] bigint  NULL,
    [CHECK_RESULT_URL] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
    [CHECK_STATUS] nvarchar(10) COLLATE Chinese_PRC_CI_AS  NULL,
    [CHECK_RESULT_PATH] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
    [CHECK_RESULT] nvarchar(max) COLLATE Chinese_PRC_CI_AS  NULL
    )
    GO

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

    EXEC sp_addextendedproperty
    'MS_Description', N'主键',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_check_result',
    'COLUMN', N'SID'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'所属指标',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_check_result',
    'COLUMN', N'INDEX_SID'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'检核频率',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_check_result',
    'COLUMN', N'CHECK_FREQUENCY'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'检核时间',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_check_result',
    'COLUMN', N'CHECK_TIME'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'检核结束时间',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_check_result',
    'COLUMN', N'CHECK_END_TIME'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'检核时长',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_check_result',
    'COLUMN', N'CHECK_DURATION'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'错误总数',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_check_result',
    'COLUMN', N'ERROR_NUM'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'总次数',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_check_result',
    'COLUMN', N'SUM_NUM'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'资源id',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_check_result',
    'COLUMN', N'RESOURCE_SID'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'资源项id',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_check_result',
    'COLUMN', N'ITEM_SID'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'错误数据关键字',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_check_result',
    'COLUMN', N'ERROR_KEYWORD'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'错误数据关键字',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_check_result',
    'COLUMN', N'ERROR_VALUE'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'归属日期',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_check_result',
    'COLUMN', N'SOURCE_DATE'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'错误数据来源目录',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_check_result',
    'COLUMN', N'ERROR_SOURCE1'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'错误数据来源资源',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_check_result',
    'COLUMN', N'ERROR_SOURCE2'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'错误数据来源定位',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_check_result',
    'COLUMN', N'ERROR_SOURCE3'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'关联"检核规则配置表"的主键',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_check_result',
    'COLUMN', N'METHOD_CONFIG_ID'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'任务id',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_check_result',
    'COLUMN', N'JOB_ID'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'日志id',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_check_result',
    'COLUMN', N'JOB_LOG_ID'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'检核结果文件下载地址',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_check_result',
    'COLUMN', N'CHECK_RESULT_URL'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'检核状态 1 成功 0失败',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_check_result',
    'COLUMN', N'CHECK_STATUS'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'检核结果上传路径',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_check_result',
    'COLUMN', N'CHECK_RESULT_PATH'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'检核结果上传路径',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_check_result',
    'COLUMN', N'CHECK_RESULT'
    GO


    -- ----------------------------
-- Records of ck_check_result
-- ----------------------------

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

CREATE TABLE [dbo].[ck_check_result_latest] (
    [METHOD_CONFIG_ID] bigint  NOT NULL,
    [JOB_ID] bigint  NULL,
    [MAX_JOB_LOG_ID] bigint  NULL,
    [MAX_CHECK_TIME] datetime2(7)  NULL
    )
    GO

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


    -- ----------------------------
-- Records of ck_check_result_latest
-- ----------------------------

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

CREATE TABLE [dbo].[ck_frequency] (
    [NAME] nvarchar(128) COLLATE Chinese_PRC_CI_AS  NOT NULL,
    [TYPE] nchar(1) COLLATE Chinese_PRC_CI_AS  NULL,
    [INTERVALNUM] int  NULL,
    [CREATE_BY] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [CREATE_TIME] datetime2(7)  NULL,
    [UPDATE_BY] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [UPDATE_TIME] datetime2(7)  NULL,
    [EXPRESSION] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [DESCRIPTION] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL
    )
    GO

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

    EXEC sp_addextendedproperty
    'MS_Description', N'如果是类型是周期性，间隔不允许为空，默认为1',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_frequency',
    'COLUMN', N'INTERVALNUM'
    GO


    -- ----------------------------
-- Records of ck_frequency
-- ----------------------------

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

CREATE TABLE [dbo].[ck_general_config] (
    [SID] bigint  NOT NULL,
    [CONFIG_TYPE] nchar(1) COLLATE Chinese_PRC_CI_AS  NULL,
    [CONFIG_NAME] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [STATE] nchar(1) COLLATE Chinese_PRC_CI_AS  NOT NULL,
    [DELETED] nchar(1) COLLATE Chinese_PRC_CI_AS  NOT NULL,
    [CREATE_BY] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NOT NULL,
    [CREATE_TIME] datetime2(7)  NOT NULL,
    [UPDATE_BY] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [UPDATE_TIME] datetime2(7)  NULL,
    [REMARK] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [STANDBY] nvarchar(500) COLLATE Chinese_PRC_CI_AS  NULL,
    [SCHEDULE_ID] bigint  NULL,
    [SCHEDULE_NAME] nvarchar(128) COLLATE Chinese_PRC_CI_AS  NULL,
    [PRINCIPAL] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [ALARM_ID] bigint  NULL,
    [CHECK_CONFIG] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL
    )
    GO

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

    EXEC sp_addextendedproperty
    'MS_Description', N'1、数据抖动 2、数据偏移 3、数据堆积 4、数据对照',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_general_config',
    'COLUMN', N'CONFIG_TYPE'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'1、新建 2、启用  3、停用',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_general_config',
    'COLUMN', N'STATE'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'责任人',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_general_config',
    'COLUMN', N'PRINCIPAL'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'CK_GENERAL_CONFIG',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_general_config'
    GO


    -- ----------------------------
-- Records of ck_general_config
-- ----------------------------

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

CREATE TABLE [dbo].[ck_general_config_detail] (
    [SID] bigint  NOT NULL,
    [CONFIG_ID] bigint  NOT NULL,
    [RESOURCE_NAME] nvarchar(2000) COLLATE Chinese_PRC_CI_AS  NULL,
    [RESOURCE_ID] bigint  NULL,
    [DATA_SOURCE_NAME] nvarchar(64) COLLATE Chinese_PRC_CI_AS  NULL,
    [INSTANCE_CODE] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [ITEM_CODE] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
    [ITEM_NAME] nvarchar(2000) COLLATE Chinese_PRC_CI_AS  NULL,
    [TABLE_CODE] nvarchar(128) COLLATE Chinese_PRC_CI_AS  NULL,
    [EXT_CONDITION] nvarchar(500) COLLATE Chinese_PRC_CI_AS  NULL,
    [UP_THRESHOLD] nvarchar(20) COLLATE Chinese_PRC_CI_AS  NULL,
    [DOWN_THRESHOLD] nvarchar(20) COLLATE Chinese_PRC_CI_AS  NULL,
    [PERIOD] int  NULL,
    [PERIOD_TYPE] nchar(1) COLLATE Chinese_PRC_CI_AS  NULL,
    [ITEM_ID] bigint  NULL,
    [DATA_SOURCE_SID] bigint  NULL,
    [SCHEMA_CODE] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL
    )
    GO

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

    EXEC sp_addextendedproperty
    'MS_Description', N'与通用检核规则配置表SID关联',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_general_config_detail',
    'COLUMN', N'CONFIG_ID'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'与资产信息表（DA_RESOURCE_INFO)表的数据资源编码（RESOURCE_NAME）关联',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_general_config_detail',
    'COLUMN', N'RESOURCE_NAME'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'与资产信息表（DA_RESOURCE_INFO)表的主键SID关联',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_general_config_detail',
    'COLUMN', N'RESOURCE_ID'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'与DS_RESOURCE_ITEM的INSTANCE_CODE关联',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_general_config_detail',
    'COLUMN', N'INSTANCE_CODE'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'与资产数据项（DA_RESOURCE_ITEM）表中的数据资源项标识（ITEM_CODE）关联',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_general_config_detail',
    'COLUMN', N'ITEM_CODE'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'与资产数据项（DA_RESOURCE_ITEM）表中的元数据项名称（ITEM_NAME）关联',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_general_config_detail',
    'COLUMN', N'ITEM_NAME'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'与资产信息表（DA_RESOURCE_INFO)表的数据资源编码（TABLE_CODE）关联',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_general_config_detail',
    'COLUMN', N'TABLE_CODE'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'1、天 2、小时 3、分钟',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_general_config_detail',
    'COLUMN', N'PERIOD_TYPE'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'CK_GENERAL_CONFIG_DETAIL',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_general_config_detail'
    GO


    -- ----------------------------
-- Records of ck_general_config_detail
-- ----------------------------

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

CREATE TABLE [dbo].[ck_general_result] (
    [SID] bigint  NOT NULL,
    [CONFIG_ID] bigint  NOT NULL,
    [AVERAGE_VALUE] nvarchar(20) COLLATE Chinese_PRC_CI_AS  NULL,
    [UP_THRESHOLD] nvarchar(20) COLLATE Chinese_PRC_CI_AS  NULL,
    [DOWN_THRESHOLD] nvarchar(20) COLLATE Chinese_PRC_CI_AS  NULL,
    [CREATE_TIME] datetime2(7)  NULL,
    [JOB_ID] bigint  NULL,
    [JOB_LOG_ID] bigint  NULL,
    [LOG_MESSAGE] nvarchar(max) COLLATE Chinese_PRC_CI_AS  NULL,
    [COUNT_OUT_OF_RANGE] bigint  NULL
    )
    GO

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

    EXEC sp_addextendedproperty
    'MS_Description', N'关联通用检核规则配置表主键SID',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_general_result',
    'COLUMN', N'CONFIG_ID'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'CK_GENERAL_RESULT',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_general_result'
    GO


    -- ----------------------------
-- Records of ck_general_result
-- ----------------------------

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

CREATE TABLE [dbo].[ck_general_result_detail] (
    [SID] bigint  NOT NULL,
    [RESULT_SID] bigint  NOT NULL,
    [DATA_SOURCE_NAME] nvarchar(64) COLLATE Chinese_PRC_CI_AS  NULL,
    [TABLE_CODE] nvarchar(128) COLLATE Chinese_PRC_CI_AS  NULL,
    [RESOURCE_ID] bigint  NULL,
    [RESOURCE_NAME] nvarchar(2000) COLLATE Chinese_PRC_CI_AS  NULL,
    [ITEM_CODE] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
    [ITEM_NAME] nvarchar(2000) COLLATE Chinese_PRC_CI_AS  NULL,
    [ACTUAL_VALUE] nvarchar(20) COLLATE Chinese_PRC_CI_AS  NULL,
    [LINE_NUM] nvarchar(20) COLLATE Chinese_PRC_CI_AS  NULL,
    [INSTANCE_CODE] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [EXT_CONDITION] nvarchar(500) COLLATE Chinese_PRC_CI_AS  NULL,
    [ITEM_ID] bigint  NULL,
    [DATA_SOURCE_SID] bigint  NULL,
    [SCHEMA_CODE] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL
    )
    GO

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

    EXEC sp_addextendedproperty
    'MS_Description', N'关联通用检核结果表的SID',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_general_result_detail',
    'COLUMN', N'RESULT_SID'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'与资产信息表（DA_RESOURCE_INFO)表的数据资源编码（TABLE_CODE）关联',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_general_result_detail',
    'COLUMN', N'TABLE_CODE'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'与资产信息表（DA_RESOURCE_INFO)表的主键SID关联',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_general_result_detail',
    'COLUMN', N'RESOURCE_ID'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'与资产信息表（DA_RESOURCE_INFO)表的数据资源编码（RESOURCE_NAME）关联',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_general_result_detail',
    'COLUMN', N'RESOURCE_NAME'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'与资产数据项（DA_RESOURCE_ITEM）表中的数据资源项标识（SID）关联',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_general_result_detail',
    'COLUMN', N'ITEM_CODE'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'与资产数据项（DA_RESOURCE_ITEM）表中的元数据项名称（ITEM_NAME）关联',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_general_result_detail',
    'COLUMN', N'ITEM_NAME'
    GO


    -- ----------------------------
-- Records of ck_general_result_detail
-- ----------------------------

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

CREATE TABLE [dbo].[ck_group] (
    [SID] bigint  NOT NULL,
    [GROUP_NAME] nvarchar(128) COLLATE Chinese_PRC_CI_AS  NULL,
    [UPPER_GROUP] bigint  NULL,
    [DESCRIPTION] nvarchar(max) COLLATE Chinese_PRC_CI_AS  NULL,
    [CREATE_BY] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [CREATE_TIME] datetime2(7)  NULL,
    [UPDATE_BY] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [UPDATE_TIME] datetime2(7)  NULL,
    [UPPER_NAME] nvarchar(128) COLLATE Chinese_PRC_CI_AS  NULL
    )
    GO

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

    EXEC sp_addextendedproperty
    'MS_Description', N'父节点id，一级节点为空',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_group',
    'COLUMN', N'UPPER_GROUP'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'简称',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_group',
    'COLUMN', N'UPPER_NAME'
    GO


    -- ----------------------------
-- Records of ck_group
-- ----------------------------

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

CREATE TABLE [dbo].[ck_group_relation] (
    [CONFIGSID] bigint  NOT NULL,
    [CONFIGTYPE] int  NOT NULL,
    [GROUPSID] bigint  NULL,
    [CREATE_BY] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [CREATE_TIME] datetime2(7)  NULL,
    [UPDATE_BY] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [UPDATE_TIME] datetime2(7)  NULL
    )
    GO

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

    EXEC sp_addextendedproperty
    'MS_Description', N'1,检核规则，2，通用检核配置',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_group_relation',
    'COLUMN', N'CONFIGTYPE'
    GO


    -- ----------------------------
-- Records of ck_group_relation
-- ----------------------------

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

CREATE TABLE [dbo].[ck_index_info] (
    [SID] bigint  NOT NULL,
    [INDEX_CODE] nvarchar(128) COLLATE Chinese_PRC_CI_AS  NULL,
    [INDEX_NAME] nvarchar(128) COLLATE Chinese_PRC_CI_AS  NULL,
    [CHECK_TYPE] nchar(1) COLLATE Chinese_PRC_CI_AS  NULL,
    [INDEX_LEVEL] nvarchar(2) COLLATE Chinese_PRC_CI_AS  NULL,
    [PARENT_SID] nvarchar(40) COLLATE Chinese_PRC_CI_AS  NULL,
    [INDEX_WEIGHT] bigint  NULL,
    [REMARK] nvarchar(max) COLLATE Chinese_PRC_CI_AS  NULL,
    [DELETED] nchar(1) COLLATE Chinese_PRC_CI_AS  NULL,
    [CREATE_BY] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [CREATE_TIME] datetime2(7)  NULL,
    [UPDATE_BY] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [UPDATE_TIME] datetime2(7)  NULL,
    [ALARM_ID] bigint  NULL,
    [ALARM_NAME] nvarchar(128) COLLATE Chinese_PRC_CI_AS  NULL
    )
    GO

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

    EXEC sp_addextendedproperty
    'MS_Description', N'主键',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_index_info',
    'COLUMN', N'SID'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'指标代码',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_index_info',
    'COLUMN', N'INDEX_CODE'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'指标名称',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_index_info',
    'COLUMN', N'INDEX_NAME'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'检核类型',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_index_info',
    'COLUMN', N'CHECK_TYPE'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'指标级别',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_index_info',
    'COLUMN', N'INDEX_LEVEL'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'上级指标ID',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_index_info',
    'COLUMN', N'PARENT_SID'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'权重（百分制）',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_index_info',
    'COLUMN', N'INDEX_WEIGHT'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'告警信息ID,关联告警信息id',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_index_info',
    'COLUMN', N'ALARM_ID'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'告警名称,关联告警信息名称',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_index_info',
    'COLUMN', N'ALARM_NAME'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'检核指标表',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_index_info'
    GO


    -- ----------------------------
-- Records of ck_index_info
-- ----------------------------

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

CREATE TABLE [dbo].[ck_index_weight_info] (
    [SID] bigint  NOT NULL,
    [INDEX_SID] bigint  NULL,
    [INDEX_NAME] nvarchar(128) COLLATE Chinese_PRC_CI_AS  NULL,
    [START_VALUE] bigint  NULL,
    [END_VALUE] bigint  NULL,
    [SCORE] bigint  NULL,
    [CREATE_BY] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [CREATE_TIME] datetime2(7)  NULL,
    [UPDATE_BY] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [UPDATE_TIME] datetime2(7)  NULL
    )
    GO

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

    EXEC sp_addextendedproperty
    'MS_Description', N'主键',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_index_weight_info',
    'COLUMN', N'SID'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'标准主键SID',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_index_weight_info',
    'COLUMN', N'INDEX_SID'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'指标名称',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_index_weight_info',
    'COLUMN', N'INDEX_NAME'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'起始值',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_index_weight_info',
    'COLUMN', N'START_VALUE'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'结束值',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_index_weight_info',
    'COLUMN', N'END_VALUE'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'分数',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_index_weight_info',
    'COLUMN', N'SCORE'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'标准权值设置表',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_index_weight_info'
    GO


    -- ----------------------------
-- Records of ck_index_weight_info
-- ----------------------------

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

CREATE TABLE [dbo].[ck_knowledge_info] (
    [SID] bigint  NOT NULL,
    [TITLE] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [CONTENT] nvarchar(max) COLLATE Chinese_PRC_CI_AS  NULL,
    [TARGET] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [DELETED] nchar(1) COLLATE Chinese_PRC_CI_AS  NULL,
    [CREATE_BY] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [CREATE_TIME] datetime2(7)  NULL,
    [UPDATE_BY] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [UPDATE_TIME] datetime2(7)  NULL,
    [PREVIEW] nvarchar(max) COLLATE Chinese_PRC_CI_AS  NULL,
    [READNUM] bigint  NULL
    )
    GO

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


    -- ----------------------------
-- Records of ck_knowledge_info
-- ----------------------------

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

CREATE TABLE [dbo].[ck_knowledge_log] (
    [SID] bigint  NOT NULL,
    [KNOWLEDGE_SID] bigint  NULL,
    [DELETED] nchar(1) COLLATE Chinese_PRC_CI_AS  NULL,
    [CREATE_BY] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [CREATE_TIME] datetime2(7)  NULL,
    [UPDATE_BY] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [UPDATE_TIME] datetime2(7)  NULL
    )
    GO

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


    -- ----------------------------
-- Records of ck_knowledge_log
-- ----------------------------

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

CREATE TABLE [dbo].[ck_method_config] (
    [SID] bigint  NOT NULL,
    [NAME] nvarchar(500) COLLATE Chinese_PRC_CI_AS  NOT NULL,
    [CODE] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [CHECK_METHOD] nchar(1) COLLATE Chinese_PRC_CI_AS  NULL,
    [RESOURCE_ID] bigint  NULL,
    [RESOURCE_NAME] nvarchar(2000) COLLATE Chinese_PRC_CI_AS  NULL,
    [ITEM_ID] bigint  NULL,
    [ITEM_CODE] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [ITEM_NAME] nvarchar(2000) COLLATE Chinese_PRC_CI_AS  NULL,
    [TABLE_CODE] nvarchar(128) COLLATE Chinese_PRC_CI_AS  NOT NULL,
    [INSTANCE_CODE] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [FULLSQL] nvarchar(3000) COLLATE Chinese_PRC_CI_AS  NULL,
    [WHERESQL] nvarchar(3000) COLLATE Chinese_PRC_CI_AS  NULL,
    [NUMSQL] nvarchar(3000) COLLATE Chinese_PRC_CI_AS  NULL,
    [CHECK_TYPE] nchar(1) COLLATE Chinese_PRC_CI_AS  NULL,
    [INDEX_ID] bigint  NULL,
    [INDEX_CODE] nvarchar(128) COLLATE Chinese_PRC_CI_AS  NULL,
    [INDEX_NAME] nvarchar(128) COLLATE Chinese_PRC_CI_AS  NULL,
    [SCHEDULE_ID] bigint  NULL,
    [SCHEDULE_NAME] nvarchar(128) COLLATE Chinese_PRC_CI_AS  NULL,
    [CONFIG_TYPE] nchar(1) COLLATE Chinese_PRC_CI_AS  NULL,
    [CHECK_TPL] int  NULL,
    [CHECK_CONFIG] nvarchar(max) COLLATE Chinese_PRC_CI_AS  NULL,
    [IS_ALARM] nchar(1) COLLATE Chinese_PRC_CI_AS  NULL,
    [ALARM_ID] bigint  NULL,
    [ALARM_NAME] nvarchar(128) COLLATE Chinese_PRC_CI_AS  NULL,
    [ALARM_TIME] datetime2(7)  NULL,
    [STATE] nchar(1) COLLATE Chinese_PRC_CI_AS  NOT NULL,
    [DELETED] nchar(1) COLLATE Chinese_PRC_CI_AS  NOT NULL,
    [CREATE_BY] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NOT NULL,
    [CREATE_TIME] datetime2(7)  NOT NULL,
    [UPDATE_BY] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [UPDATE_TIME] datetime2(7)  NULL,
    [REMARK] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [STANDBY] nvarchar(500) COLLATE Chinese_PRC_CI_AS  NULL,
    [SHOW_FIELD] nvarchar(2000) COLLATE Chinese_PRC_CI_AS  NULL,
    [DATA_SOURCE_NAME] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [DATA_SOURCE_SID] bigint  NULL,
    [RESOURCE_TYPE] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [SCHEMA_CODE] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [PRINCIPAL] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [SINK_MODE] nvarchar(64) COLLATE Chinese_PRC_CI_AS  NULL,
    [DATA_FROM] nvarchar(64) COLLATE Chinese_PRC_CI_AS  NULL
    )
    GO

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

    EXEC sp_addextendedproperty
    'MS_Description', N'保留字段',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_method_config',
    'COLUMN', N'CODE'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'1、SQL检核 2、NOSQL检核',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_method_config',
    'COLUMN', N'CHECK_METHOD'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'与资产信息表（DA_RESOURCE_INFO)表的主键SID关联',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_method_config',
    'COLUMN', N'RESOURCE_ID'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'与资产信息表（DA_RESOURCE_INFO)表的数据资源编码（RESOURCE_NAME）关联',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_method_config',
    'COLUMN', N'RESOURCE_NAME'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'与资产数据项（DA_RESOURCE_ITEM）表中的数据资源项标识（SID）关联',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_method_config',
    'COLUMN', N'ITEM_ID'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'与资产数据项（DA_RESOURCE_ITEM）表中的元数据项编码（ITEM_CODE）关联',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_method_config',
    'COLUMN', N'ITEM_CODE'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'与资产数据项（DA_RESOURCE_ITEM）表中的元数据项名称（ITEM_NAME）关联',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_method_config',
    'COLUMN', N'ITEM_NAME'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'与资产信息表（DA_RESOURCE_INFO)表的数据资源编码（TABLE_CODE）关联',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_method_config',
    'COLUMN', N'TABLE_CODE'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'与DS_RESOURCE_ITEM的INSTANCE_CODE关联',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_method_config',
    'COLUMN', N'INSTANCE_CODE'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'根据前端配置的信息，组装成的完整的SQL 如果条件中存在{CheckField}占位符，则需要替换为相应的字段名称',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_method_config',
    'COLUMN', N'FULLSQL'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'SQL配置方式中，用户输入的where的SQL语句',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_method_config',
    'COLUMN', N'WHERESQL'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'指标id（SQL检核配置需要写入）',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_method_config',
    'COLUMN', N'INDEX_ID'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'1、可视化配置   2、SQL配置',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_method_config',
    'COLUMN', N'CONFIG_TYPE'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'检核模板',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_method_config',
    'COLUMN', N'CHECK_TPL'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'检查配置JSON',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_method_config',
    'COLUMN', N'CHECK_CONFIG'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'1、自定义告警  0、默认使用检核指标配置的告警 默认是0',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_method_config',
    'COLUMN', N'IS_ALARM'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'1、新建 2、启用 3、停用',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_method_config',
    'COLUMN', N'STATE'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'显示字段',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_method_config',
    'COLUMN', N'SHOW_FIELD'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'数据源名称',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_method_config',
    'COLUMN', N'DATA_SOURCE_NAME'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'数据源SID',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_method_config',
    'COLUMN', N'DATA_SOURCE_SID'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'资源类型',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_method_config',
    'COLUMN', N'RESOURCE_TYPE'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'责任人',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_method_config',
    'COLUMN', N'PRINCIPAL'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'结果输出方式',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_method_config',
    'COLUMN', N'SINK_MODE'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'检核规则创建来源, 默认为NULL',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_method_config',
    'COLUMN', N'DATA_FROM'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'此表用于配置检核规则（即原检核方法配置）CK_METHOD_CONFIG',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_method_config'
    GO


    -- ----------------------------
-- Records of ck_method_config
-- ----------------------------

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

CREATE TABLE [dbo].[ck_method_config_course] (
    [SID] bigint  NOT NULL,
    [METHOD_CONFIG_ID] bigint  NULL,
    [OPT] nchar(2) COLLATE Chinese_PRC_CI_AS  NULL,
    [TABLE_CODE] nvarchar(128) COLLATE Chinese_PRC_CI_AS  NULL,
    [ITEM_CODE] nvarchar(128) COLLATE Chinese_PRC_CI_AS  NULL,
    [INSTANCE_CODE] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [WILDCARD] nchar(1) COLLATE Chinese_PRC_CI_AS  NULL,
    [ACTUAL_VALUE] nvarchar(128) COLLATE Chinese_PRC_CI_AS  NULL,
    [STARTTIME] nvarchar(20) COLLATE Chinese_PRC_CI_AS  NULL,
    [ENDTIME] nvarchar(20) COLLATE Chinese_PRC_CI_AS  NULL,
    [DICT_ID] nvarchar(20) COLLATE Chinese_PRC_CI_AS  NULL,
    [ITEM_ID] bigint  NULL,
    [ITEM_NAME] nvarchar(128) COLLATE Chinese_PRC_CI_AS  NULL
    )
    GO

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

    EXEC sp_addextendedproperty
    'MS_Description', N'&&且 ||或',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_method_config_course',
    'COLUMN', N'OPT'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'前缀匹配、后缀匹配、全模糊匹配、等于、不等于、包含、不包含、大于、大于等于、小于、小于等于、区间（包括边界）、区间（不包括边界）、区间（包含前边界）、区间（包含后边界）',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_method_config_course',
    'COLUMN', N'WILDCARD'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'记录SQL检核配置过程的表。主要是记录可视化配置的信息',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_method_config_course'
    GO


    -- ----------------------------
-- Records of ck_method_config_course
-- ----------------------------

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

CREATE TABLE [dbo].[ck_method_item] (
    [SID] bigint  NOT NULL,
    [CONFIG_SID] bigint  NULL,
    [INDEX_SID] bigint  NULL,
    [PARENT_SID] bigint  NULL,
    [OPT] nvarchar(10) COLLATE Chinese_PRC_CI_AS  NULL,
    [RULE_SID] bigint  NULL,
    [EXPRESSION] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
    [IDENTIFIER] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
    [CHECK_MODE] nchar(1) COLLATE Chinese_PRC_CI_AS  NULL,
    [DELETED] nchar(1) COLLATE Chinese_PRC_CI_AS  NULL,
    [CREATE_BY] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [CREATE_TIME] datetime2(7)  NULL,
    [UPDATE_BY] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [UPDATE_TIME] datetime2(7)  NULL,
    [REMARK] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [STANDBY] nvarchar(500) COLLATE Chinese_PRC_CI_AS  NULL
    )
    GO

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

    EXEC sp_addextendedproperty
    'MS_Description', N'数据项ID',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_method_item',
    'COLUMN', N'CONFIG_SID'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'指标ID',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_method_item',
    'COLUMN', N'INDEX_SID'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'父级ID',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_method_item',
    'COLUMN', N'PARENT_SID'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'规则ID',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_method_item',
    'COLUMN', N'RULE_SID'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'CK_METHOD_ITEM',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_method_item'
    GO


    -- ----------------------------
-- Records of ck_method_item
-- ----------------------------

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

CREATE TABLE [dbo].[ck_result_detail] (
    [SID] bigint  NOT NULL,
    [RESULTID] bigint  NULL,
    [CHECK_COLUMN] nvarchar(1000) COLLATE Chinese_PRC_CI_AS  NULL,
    [COLUMN1] nvarchar(500) COLLATE Chinese_PRC_CI_AS  NULL,
    [COLUMN2] nvarchar(500) COLLATE Chinese_PRC_CI_AS  NULL,
    [COLUMN3] nvarchar(500) COLLATE Chinese_PRC_CI_AS  NULL,
    [COLUMN4] nvarchar(500) COLLATE Chinese_PRC_CI_AS  NULL,
    [COLUMN5] nvarchar(500) COLLATE Chinese_PRC_CI_AS  NULL,
    [COLUMN6] nvarchar(500) COLLATE Chinese_PRC_CI_AS  NULL,
    [COLUMN7] nvarchar(500) COLLATE Chinese_PRC_CI_AS  NULL,
    [COLUMN8] nvarchar(500) COLLATE Chinese_PRC_CI_AS  NULL,
    [COLUMN9] nvarchar(500) COLLATE Chinese_PRC_CI_AS  NULL,
    [COLUMN10] nvarchar(500) COLLATE Chinese_PRC_CI_AS  NULL,
    [COLUMN11] nvarchar(500) COLLATE Chinese_PRC_CI_AS  NULL,
    [COLUMN12] nvarchar(500) COLLATE Chinese_PRC_CI_AS  NULL,
    [COLUMN13] nvarchar(500) COLLATE Chinese_PRC_CI_AS  NULL,
    [COLUMN14] nvarchar(500) COLLATE Chinese_PRC_CI_AS  NULL,
    [COLUMN15] nvarchar(500) COLLATE Chinese_PRC_CI_AS  NULL,
    [COLUMN16] nvarchar(500) COLLATE Chinese_PRC_CI_AS  NULL,
    [COLUMN17] nvarchar(500) COLLATE Chinese_PRC_CI_AS  NULL,
    [COLUMN18] nvarchar(500) COLLATE Chinese_PRC_CI_AS  NULL,
    [COLUMN19] nvarchar(500) COLLATE Chinese_PRC_CI_AS  NULL,
    [COLUMN20] nvarchar(500) COLLATE Chinese_PRC_CI_AS  NULL,
    [COLUMN21] nvarchar(500) COLLATE Chinese_PRC_CI_AS  NULL,
    [COLUMN22] nvarchar(500) COLLATE Chinese_PRC_CI_AS  NULL,
    [COLUMN23] nvarchar(500) COLLATE Chinese_PRC_CI_AS  NULL,
    [COLUMN24] nvarchar(500) COLLATE Chinese_PRC_CI_AS  NULL,
    [COLUMN25] nvarchar(500) COLLATE Chinese_PRC_CI_AS  NULL,
    [COLUMN26] nvarchar(500) COLLATE Chinese_PRC_CI_AS  NULL,
    [COLUMN27] nvarchar(500) COLLATE Chinese_PRC_CI_AS  NULL,
    [COLUMN28] nvarchar(500) COLLATE Chinese_PRC_CI_AS  NULL,
    [COLUMN29] nvarchar(500) COLLATE Chinese_PRC_CI_AS  NULL,
    [COLUMN30] nvarchar(500) COLLATE Chinese_PRC_CI_AS  NULL,
    [COLUMN31] nvarchar(500) COLLATE Chinese_PRC_CI_AS  NULL,
    [COLUMN32] nvarchar(500) COLLATE Chinese_PRC_CI_AS  NULL,
    [COLUMN33] nvarchar(500) COLLATE Chinese_PRC_CI_AS  NULL,
    [COLUMN34] nvarchar(500) COLLATE Chinese_PRC_CI_AS  NULL,
    [CREATE_BY] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [CREATE_TIME] datetime2(7)  NULL,
    [UPDATE_BY] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [UPDATE_TIME] datetime2(7)  NULL,
    [TYPE] nchar(1) COLLATE Chinese_PRC_CI_AS  NULL
    )
    GO

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

    EXEC sp_addextendedproperty
    'MS_Description', N'预留字段1',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_result_detail',
    'COLUMN', N'COLUMN1'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'预留字段2',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_result_detail',
    'COLUMN', N'COLUMN2'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'预留字段3',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_result_detail',
    'COLUMN', N'COLUMN3'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'预留字段4',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_result_detail',
    'COLUMN', N'COLUMN4'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'预留字段5',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_result_detail',
    'COLUMN', N'COLUMN5'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'1字段名，2字段对应的值',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_result_detail',
    'COLUMN', N'TYPE'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'检核结果明细表 CK_RESULT_DETAIL',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_result_detail'
    GO


    -- ----------------------------
-- Records of ck_result_detail
-- ----------------------------

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

CREATE TABLE [dbo].[ck_result_options] (
    [SID] bigint  NOT NULL,
    [CHECK_METHOD] nchar(1) COLLATE Chinese_PRC_CI_AS  NOT NULL,
    [RESULT_SID] bigint  NOT NULL,
    [OPTION_SID] bigint  NOT NULL,
    [DELETED] nchar(1) COLLATE Chinese_PRC_CI_AS  NULL,
    [CREATE_BY] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [CREATE_TIME] datetime2(7)  NULL,
    [UPDATE_BY] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [UPDATE_TIME] datetime2(7)  NULL,
    [REMARK] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [STANDBY] nvarchar(500) COLLATE Chinese_PRC_CI_AS  NULL
    )
    GO

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

    EXEC sp_addextendedproperty
    'MS_Description', N'1、SQL检核 2、NOSQL检核',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_result_options',
    'COLUMN', N'CHECK_METHOD'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'关联damp库下的PO_OPTIONS表的SID',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_result_options',
    'COLUMN', N'OPTION_SID'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'检核结果与问题的对应关系表',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_result_options'
    GO


    -- ----------------------------
-- Records of ck_result_options
-- ----------------------------

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

CREATE TABLE [dbo].[ck_rule_info] (
    [SID] bigint  NOT NULL,
    [RULE_CODE] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
    [RULE_NAME] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
    [RULE_OPTION] nvarchar(20) COLLATE Chinese_PRC_CI_AS  NULL,
    [RULE_VALUE] nvarchar(max) COLLATE Chinese_PRC_CI_AS  NULL,
    [RULE_VALUE_TYPE] nchar(1) COLLATE Chinese_PRC_CI_AS  NULL,
    [EXPRESSION] nvarchar(max) COLLATE Chinese_PRC_CI_AS  NULL,
    [REMARK] nvarchar(max) COLLATE Chinese_PRC_CI_AS  NULL,
    [DELETED] nchar(1) COLLATE Chinese_PRC_CI_AS  NULL,
    [CREATE_BY] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [CREATE_TIME] datetime2(7)  NULL,
    [UPDATE_BY] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [UPDATE_TIME] datetime2(7)  NULL
    )
    GO

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

    EXEC sp_addextendedproperty
    'MS_Description', N'规则编码',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_rule_info',
    'COLUMN', N'RULE_CODE'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'规则名称',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_rule_info',
    'COLUMN', N'RULE_NAME'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'操作符，CK_RULE_OPTION 包含【=,!=,<,>,match,in等】',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_rule_info',
    'COLUMN', N'RULE_OPTION'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'规则值，包含【具体值，正则表达式，表名.字段名 等】',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_rule_info',
    'COLUMN', N'RULE_VALUE'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'规则值类型，CK_RULE_VALUE_TYPE :包含【1为普通值；2为特殊值；3为码表值】',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_rule_info',
    'COLUMN', N'RULE_VALUE_TYPE'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'根据操作符和规则值运算出来的最终表达式',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_rule_info',
    'COLUMN', N'EXPRESSION'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'备注',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_rule_info',
    'COLUMN', N'REMARK'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'是否删除 0:否 1:是',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_rule_info',
    'COLUMN', N'DELETED'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'数据检核规则',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_rule_info'
    GO


    -- ----------------------------
-- Records of ck_rule_info
-- ----------------------------

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

CREATE TABLE [dbo].[ck_schedule_config] (
    [SID] bigint  NOT NULL,
    [NAME] nvarchar(128) COLLATE Chinese_PRC_CI_AS  NULL,
    [JOB_ID] int  NULL,
    [JOB_GROUP] int  NULL,
    [TYPE] nchar(1) COLLATE Chinese_PRC_CI_AS  NULL,
    [INTERVALNUM] int  NULL,
    [STARTTIME] nvarchar(20) COLLATE Chinese_PRC_CI_AS  NULL,
    [JOB_HANDLER] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [STATE] nchar(1) COLLATE Chinese_PRC_CI_AS  NOT NULL,
    [DELETED] nchar(1) COLLATE Chinese_PRC_CI_AS  NOT NULL,
    [CREATE_BY] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NOT NULL,
    [CREATE_TIME] datetime2(7)  NOT NULL,
    [UPDATE_BY] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [UPDATE_TIME] datetime2(7)  NULL,
    [REMARK] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [STANDBY] nvarchar(500) COLLATE Chinese_PRC_CI_AS  NULL,
    [CALENDAR] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [FREQUENCY_NAME] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [EXPRESSION] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL
    )
    GO

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

    EXEC sp_addextendedproperty
    'MS_Description', N'关联xxljob任务的主键id',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_schedule_config',
    'COLUMN', N'JOB_ID'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'XXLJOB的执行器id',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_schedule_config',
    'COLUMN', N'JOB_GROUP'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'如果是类型是周期性，间隔不允许为空，默认为1',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_schedule_config',
    'COLUMN', N'INTERVALNUM'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'任务类别',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_schedule_config',
    'COLUMN', N'JOB_HANDLER'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'1、新建 2、启用 3、停用',
    'SCHEMA', N'dbo',
    'TABLE', N'ck_schedule_config',
    'COLUMN', N'STATE'
    GO


    -- ----------------------------
-- Records of ck_schedule_config
-- ----------------------------

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

CREATE TABLE [dbo].[cl_classif_info] (
    [SID] bigint  NOT NULL,
    [CLASSIF_NAME] nvarchar(128) COLLATE Chinese_PRC_CI_AS  NULL,
    [UPPER_CLASSIF] bigint  NULL,
    [SEQ] nvarchar(1024) COLLATE Chinese_PRC_CI_AS  NULL,
    [IS_LEAF] nchar(1) COLLATE Chinese_PRC_CI_AS  NULL,
    [DISPLAY_ORDER] bigint  NULL,
    [DESCRIPTION] nvarchar(max) COLLATE Chinese_PRC_CI_AS  NULL,
    [LEVEL_NUM] bigint  NULL,
    [CLASSIF_FULL_NAME] nvarchar(500) COLLATE Chinese_PRC_CI_AS  NULL,
    [CLASSIF_TYPE] nvarchar(5) COLLATE Chinese_PRC_CI_AS  NULL,
    [RESOURCE_MAPPING] nvarchar(128) COLLATE Chinese_PRC_CI_AS  NULL,
    [IS_AUTH] nchar(1) COLLATE Chinese_PRC_CI_AS  NULL,
    [CREATE_BY] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [CREATE_TIME] datetime2(7)  NULL,
    [UPDATE_BY] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [UPDATE_TIME] datetime2(7)  NULL,
    [CLASSIFTEMPLATE] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [SHOW_SCHEMA] nvarchar(10) COLLATE Chinese_PRC_CI_AS  NULL,
    [ABBR_NAME] nvarchar(128) COLLATE Chinese_PRC_CI_AS  NULL
    )
    GO

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

    EXEC sp_addextendedproperty
    'MS_Description', N'父节点id，一级节点为空',
    'SCHEMA', N'dbo',
    'TABLE', N'cl_classif_info',
    'COLUMN', N'UPPER_CLASSIF'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'.11.22.33.',
    'SCHEMA', N'dbo',
    'TABLE', N'cl_classif_info',
    'COLUMN', N'SEQ'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'Y/N',
    'SCHEMA', N'dbo',
    'TABLE', N'cl_classif_info',
    'COLUMN', N'IS_LEAF'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'1、2、3...99',
    'SCHEMA', N'dbo',
    'TABLE', N'cl_classif_info',
    'COLUMN', N'DISPLAY_ORDER'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'1、2、3',
    'SCHEMA', N'dbo',
    'TABLE', N'cl_classif_info',
    'COLUMN', N'LEVEL_NUM'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'一级名称-二级名称-叶子名称',
    'SCHEMA', N'dbo',
    'TABLE', N'cl_classif_info',
    'COLUMN', N'CLASSIF_FULL_NAME'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'自动映射数据资源',
    'SCHEMA', N'dbo',
    'TABLE', N'cl_classif_info',
    'COLUMN', N'RESOURCE_MAPPING'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'确定该分类是否需要做鉴权 0:不需要 1:需要',
    'SCHEMA', N'dbo',
    'TABLE', N'cl_classif_info',
    'COLUMN', N'IS_AUTH'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'是否展示SCHEMA节点 0:否,1:是',
    'SCHEMA', N'dbo',
    'TABLE', N'cl_classif_info',
    'COLUMN', N'SHOW_SCHEMA'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'简称',
    'SCHEMA', N'dbo',
    'TABLE', N'cl_classif_info',
    'COLUMN', N'ABBR_NAME'
    GO


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

CREATE TABLE [dbo].[cl_data_classif] (
    [RESOURCE_ID] bigint  NOT NULL,
    [CLASSIF_SID] bigint  NOT NULL,
    [RESOURCE_TYPE] nchar(1) COLLATE Chinese_PRC_CI_AS  NULL,
    [CREATE_BY] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [CREATE_TIME] datetime2(7)  NULL,
    [UPDATE_BY] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [UPDATE_TIME] datetime2(7)  NULL
    )
    GO

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

    EXEC sp_addextendedproperty
    'MS_Description', N'资源注册后，关联数据资源',
    'SCHEMA', N'dbo',
    'TABLE', N'cl_data_classif',
    'COLUMN', N'RESOURCE_ID'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'目录级、数据级、数据项级',
    'SCHEMA', N'dbo',
    'TABLE', N'cl_data_classif',
    'COLUMN', N'RESOURCE_TYPE'
    GO


    -- ----------------------------
-- Records of cl_data_classif
-- ----------------------------

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

CREATE TABLE [dbo].[cl_data_level] (
    [RESOURCE_SID] bigint  NOT NULL,
    [LEVEL_SID] bigint  NOT NULL,
    [RESOURCE_TYPE] nchar(1) COLLATE Chinese_PRC_CI_AS  NULL,
    [CREATE_BY] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [CREATE_TIME] datetime2(7)  NULL,
    [UPDATE_BY] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [UPDATE_TIME] datetime2(7)  NULL
    )
    GO

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

    EXEC sp_addextendedproperty
    'MS_Description', N'资源注册后，关联数据资源',
    'SCHEMA', N'dbo',
    'TABLE', N'cl_data_level',
    'COLUMN', N'RESOURCE_SID'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'0目录级、1数据级、2数据项级',
    'SCHEMA', N'dbo',
    'TABLE', N'cl_data_level',
    'COLUMN', N'RESOURCE_TYPE'
    GO


    -- ----------------------------
-- Records of cl_data_level
-- ----------------------------

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

CREATE TABLE [dbo].[cl_level_info] (
    [SID] bigint  NOT NULL,
    [LEVEL_CODE] bigint  NULL,
    [LEVEL_NAME] nvarchar(64) COLLATE Chinese_PRC_CI_AS  NULL,
    [LEVEL_DESC] nvarchar(128) COLLATE Chinese_PRC_CI_AS  NULL,
    [UPPER_LEVEL] bigint  NULL,
    [LEVEL_NUM] bigint  NULL,
    [CREATE_BY] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [CREATE_TIME] datetime2(7)  NULL,
    [UPDATE_BY] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [UPDATE_TIME] datetime2(7)  NULL
    )
    GO

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

    EXEC sp_addextendedproperty
    'MS_Description', N'第一级时为空',
    'SCHEMA', N'dbo',
    'TABLE', N'cl_level_info',
    'COLUMN', N'UPPER_LEVEL'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'1/2',
    'SCHEMA', N'dbo',
    'TABLE', N'cl_level_info',
    'COLUMN', N'LEVEL_NUM'
    GO


    -- ----------------------------
-- Records of cl_level_info
-- ----------------------------

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

CREATE TABLE [dbo].[cl_resouce_count] (
    [sid] bigint  NOT NULL,
    [TOTAL_NUM] int  NULL,
[BATCH_NUMBER] bigint  NULL
)
    GO

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


    -- ----------------------------
-- Records of cl_resouce_count
-- ----------------------------

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

CREATE TABLE [dbo].[cl_resouce_count_temp] (
    [sid] bigint  NOT NULL,
    [TOTAL_NUM] int  NULL,
[BATCH_NUMBER] bigint  NULL
)
    GO

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

    EXEC sp_addextendedproperty
    'MS_Description', N'批次号',
    'SCHEMA', N'dbo',
    'TABLE', N'cl_resouce_count_temp',
    'COLUMN', N'BATCH_NUMBER'
    GO


    -- ----------------------------
-- Records of cl_resouce_count_temp
-- ----------------------------

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

CREATE TABLE [dbo].[cl_role_classif] (
    [ROLE_SID] nvarchar(65) COLLATE Chinese_PRC_CI_AS  NOT NULL,
    [CLASSIF_SID] bigint  NOT NULL,
    [CREATE_BY] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [CREATE_TIME] datetime2(7)  NULL,
    [UPDATE_BY] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [UPDATE_TIME] datetime2(7)  NULL
    )
    GO

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





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

CREATE TABLE [dbo].[cl_role_level] (
    [ROLE_SID] nvarchar(65) COLLATE Chinese_PRC_CI_AS  NOT NULL,
    [LEVEL_SID] bigint  NOT NULL,
    [CREATE_BY] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [CREATE_TIME] datetime2(7)  NULL,
    [UPDATE_BY] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [UPDATE_TIME] datetime2(7)  NULL
    )
    GO

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


    -- ----------------------------
-- Records of cl_role_level
-- ----------------------------

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

CREATE TABLE [dbo].[cof_dict_entry] (
    [ID] nvarchar(64) COLLATE Chinese_PRC_CI_AS  NOT NULL,
    [CODE] nvarchar(64) COLLATE Chinese_PRC_CI_AS  NULL,
    [DICT_TYPE_ID] nvarchar(64) COLLATE Chinese_PRC_CI_AS  NULL,
    [NAME] nvarchar(512) COLLATE Chinese_PRC_CI_AS  NULL,
    [DESCRIPTION] nvarchar(256) COLLATE Chinese_PRC_CI_AS  NULL,
    [CREATE_TIME] datetime2(7)  NULL,
    [UPDATE_TIME] datetime2(7)  NULL,
    [TENANT_ID] nvarchar(64) COLLATE Chinese_PRC_CI_AS  NULL,
    [PARENT_ID] nvarchar(64) COLLATE Chinese_PRC_CI_AS  NULL,
    [LOCALE] nvarchar(64) COLLATE Chinese_PRC_CI_AS  NULL,
    [STATUS] nvarchar(64) COLLATE Chinese_PRC_CI_AS  NULL,
    [SORT_NO] int  NULL,
    [IS_LEAF] tinyint  NULL,
    [TREE_LEVEL] int  NULL,
    [SEQ] nvarchar(256) COLLATE Chinese_PRC_CI_AS  NULL,
    [IS_FIXED] tinyint  NULL
    )
    GO

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

    EXEC sp_addextendedproperty
    'MS_Description', N'字典项ID',
    'SCHEMA', N'dbo',
    'TABLE', N'cof_dict_entry',
    'COLUMN', N'ID'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'字典项编码',
    'SCHEMA', N'dbo',
    'TABLE', N'cof_dict_entry',
    'COLUMN', N'CODE'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'字典类型ID',
    'SCHEMA', N'dbo',
    'TABLE', N'cof_dict_entry',
    'COLUMN', N'DICT_TYPE_ID'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'字典项名称',
    'SCHEMA', N'dbo',
    'TABLE', N'cof_dict_entry',
    'COLUMN', N'NAME'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'描述',
    'SCHEMA', N'dbo',
    'TABLE', N'cof_dict_entry',
    'COLUMN', N'DESCRIPTION'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'创建时间',
    'SCHEMA', N'dbo',
    'TABLE', N'cof_dict_entry',
    'COLUMN', N'CREATE_TIME'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'更新时间',
    'SCHEMA', N'dbo',
    'TABLE', N'cof_dict_entry',
    'COLUMN', N'UPDATE_TIME'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'租户ID',
    'SCHEMA', N'dbo',
    'TABLE', N'cof_dict_entry',
    'COLUMN', N'TENANT_ID'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'父字典项ID',
    'SCHEMA', N'dbo',
    'TABLE', N'cof_dict_entry',
    'COLUMN', N'PARENT_ID'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'默认语言',
    'SCHEMA', N'dbo',
    'TABLE', N'cof_dict_entry',
    'COLUMN', N'LOCALE'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'状态 ',
    'SCHEMA', N'dbo',
    'TABLE', N'cof_dict_entry',
    'COLUMN', N'STATUS'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'排序字段',
    'SCHEMA', N'dbo',
    'TABLE', N'cof_dict_entry',
    'COLUMN', N'SORT_NO'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'是否叶节点',
    'SCHEMA', N'dbo',
    'TABLE', N'cof_dict_entry',
    'COLUMN', N'IS_LEAF'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'层级',
    'SCHEMA', N'dbo',
    'TABLE', N'cof_dict_entry',
    'COLUMN', N'TREE_LEVEL'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'序列码',
    'SCHEMA', N'dbo',
    'TABLE', N'cof_dict_entry',
    'COLUMN', N'SEQ'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'是否固定，如果是，则数据不能修改，不能删除',
    'SCHEMA', N'dbo',
    'TABLE', N'cof_dict_entry',
    'COLUMN', N'IS_FIXED'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'字典项',
    'SCHEMA', N'dbo',
    'TABLE', N'cof_dict_entry'
    GO





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

CREATE TABLE [dbo].[cof_dict_type] (
    [ID] nvarchar(64) COLLATE Chinese_PRC_CI_AS  NOT NULL,
    [CODE] nvarchar(64) COLLATE Chinese_PRC_CI_AS  NULL,
    [NAME] nvarchar(128) COLLATE Chinese_PRC_CI_AS  NULL,
    [DESCRIPTION] nvarchar(256) COLLATE Chinese_PRC_CI_AS  NULL,
    [CREATE_TIME] datetime2(7)  NULL,
    [UPDATE_TIME] datetime2(7)  NULL,
    [TENANT_ID] nvarchar(64) COLLATE Chinese_PRC_CI_AS  NULL,
    [PARENT_ID] nvarchar(64) COLLATE Chinese_PRC_CI_AS  NULL,
    [LOCALE] nvarchar(64) COLLATE Chinese_PRC_CI_AS  NULL,
    [SORT_NO] int  NULL,
    [IS_LEAF] tinyint  NULL,
    [TREE_LEVEL] int  NULL,
    [SEQ] nvarchar(256) COLLATE Chinese_PRC_CI_AS  NULL,
    [IS_FIXED] tinyint  NULL
    )
    GO

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

    EXEC sp_addextendedproperty
    'MS_Description', N'字典类型ID',
    'SCHEMA', N'dbo',
    'TABLE', N'cof_dict_type',
    'COLUMN', N'ID'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'字典类型编码',
    'SCHEMA', N'dbo',
    'TABLE', N'cof_dict_type',
    'COLUMN', N'CODE'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'字典类型名称',
    'SCHEMA', N'dbo',
    'TABLE', N'cof_dict_type',
    'COLUMN', N'NAME'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'描述',
    'SCHEMA', N'dbo',
    'TABLE', N'cof_dict_type',
    'COLUMN', N'DESCRIPTION'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'创建时间',
    'SCHEMA', N'dbo',
    'TABLE', N'cof_dict_type',
    'COLUMN', N'CREATE_TIME'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'更新时间',
    'SCHEMA', N'dbo',
    'TABLE', N'cof_dict_type',
    'COLUMN', N'UPDATE_TIME'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'租户ID',
    'SCHEMA', N'dbo',
    'TABLE', N'cof_dict_type',
    'COLUMN', N'TENANT_ID'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'父字典类型ID',
    'SCHEMA', N'dbo',
    'TABLE', N'cof_dict_type',
    'COLUMN', N'PARENT_ID'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'默认语言',
    'SCHEMA', N'dbo',
    'TABLE', N'cof_dict_type',
    'COLUMN', N'LOCALE'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'排序字段',
    'SCHEMA', N'dbo',
    'TABLE', N'cof_dict_type',
    'COLUMN', N'SORT_NO'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'是否叶节点',
    'SCHEMA', N'dbo',
    'TABLE', N'cof_dict_type',
    'COLUMN', N'IS_LEAF'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'层级',
    'SCHEMA', N'dbo',
    'TABLE', N'cof_dict_type',
    'COLUMN', N'TREE_LEVEL'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'序列码',
    'SCHEMA', N'dbo',
    'TABLE', N'cof_dict_type',
    'COLUMN', N'SEQ'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'是否固定，如果是，则数据不能修改，不能删除',
    'SCHEMA', N'dbo',
    'TABLE', N'cof_dict_type',
    'COLUMN', N'IS_FIXED'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'字典类型',
    'SCHEMA', N'dbo',
    'TABLE', N'cof_dict_type'
    GO




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

CREATE TABLE [dbo].[dqms_operation_log] (
    [ID] nvarchar(64) COLLATE Chinese_PRC_CI_AS  NOT NULL,
    [OPERATOR_ID] nvarchar(64) COLLATE Chinese_PRC_CI_AS  NULL,
    [OPERATOR_NAME] nvarchar(64) COLLATE Chinese_PRC_CI_AS  NULL,
    [OPERATE_TYPE] int  NULL,
    [OPERATE_DATE] datetime2(7)  NULL,
    [TARGET_TYPE] nvarchar(64) COLLATE Chinese_PRC_CI_AS  NULL,
    [TARGET_MODEL_ID] nvarchar(64) COLLATE Chinese_PRC_CI_AS  NULL,
    [TARGET_MODEL_NAME] nvarchar(64) COLLATE Chinese_PRC_CI_AS  NULL,
    [MESSAGE] nvarchar(max) COLLATE Chinese_PRC_CI_AS  NULL,
    [TENANT_ID] nvarchar(64) COLLATE Chinese_PRC_CI_AS  NULL
    )
    GO

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

    EXEC sp_addextendedproperty
    'MS_Description', N'操作日志ID',
    'SCHEMA', N'dbo',
    'TABLE', N'dqms_operation_log',
    'COLUMN', N'ID'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'操作者ID',
    'SCHEMA', N'dbo',
    'TABLE', N'dqms_operation_log',
    'COLUMN', N'OPERATOR_ID'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'操作者名称',
    'SCHEMA', N'dbo',
    'TABLE', N'dqms_operation_log',
    'COLUMN', N'OPERATOR_NAME'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'操作类型',
    'SCHEMA', N'dbo',
    'TABLE', N'dqms_operation_log',
    'COLUMN', N'OPERATE_TYPE'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'时间',
    'SCHEMA', N'dbo',
    'TABLE', N'dqms_operation_log',
    'COLUMN', N'OPERATE_DATE'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'目标类型',
    'SCHEMA', N'dbo',
    'TABLE', N'dqms_operation_log',
    'COLUMN', N'TARGET_TYPE'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'目标ID',
    'SCHEMA', N'dbo',
    'TABLE', N'dqms_operation_log',
    'COLUMN', N'TARGET_MODEL_ID'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'目标名称',
    'SCHEMA', N'dbo',
    'TABLE', N'dqms_operation_log',
    'COLUMN', N'TARGET_MODEL_NAME'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'信息',
    'SCHEMA', N'dbo',
    'TABLE', N'dqms_operation_log',
    'COLUMN', N'MESSAGE'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'租户ID',
    'SCHEMA', N'dbo',
    'TABLE', N'dqms_operation_log',
    'COLUMN', N'TENANT_ID'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'操作日志',
    'SCHEMA', N'dbo',
    'TABLE', N'dqms_operation_log'
    GO


    -- ----------------------------
-- Records of dqms_operation_log
-- ----------------------------

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

CREATE TABLE [dbo].[dqms_operation_log_detail] (
    [ID] nvarchar(64) COLLATE Chinese_PRC_CI_AS  NOT NULL,
    [OLD_DATA_JSON] nvarchar(max) COLLATE Chinese_PRC_CI_AS  NULL,
    [NEW_DATA_JSON] nvarchar(max) COLLATE Chinese_PRC_CI_AS  NULL
    )
    GO

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

    EXEC sp_addextendedproperty
    'MS_Description', N'日志详情ID',
    'SCHEMA', N'dbo',
    'TABLE', N'dqms_operation_log_detail',
    'COLUMN', N'ID'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'旧值',
    'SCHEMA', N'dbo',
    'TABLE', N'dqms_operation_log_detail',
    'COLUMN', N'OLD_DATA_JSON'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'新值',
    'SCHEMA', N'dbo',
    'TABLE', N'dqms_operation_log_detail',
    'COLUMN', N'NEW_DATA_JSON'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'操作日志详情',
    'SCHEMA', N'dbo',
    'TABLE', N'dqms_operation_log_detail'
    GO


    -- ----------------------------
-- Records of dqms_operation_log_detail
-- ----------------------------

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

CREATE TABLE [dbo].[dqms_rating_result] (
    [ID] bigint  NOT NULL,
    [ORG_ID] nvarchar(64) COLLATE Chinese_PRC_CI_AS  NULL,
    [ORG_NAME] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
    [ORG_LEVEL] nvarchar(2) COLLATE Chinese_PRC_CI_AS  NULL,
    [PARENT_ORG_ID] nvarchar(64) COLLATE Chinese_PRC_CI_AS  NULL,
    [SCORE] float(53)  NULL,
    [START_DATE] datetime2(7)  NULL,
    [END_DATE] datetime2(7)  NULL,
    [RATING_CYCLE] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
    [RATING_POINT] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
    [CREATE_TIME] datetime2(7)  NULL,
    [CREATE_USER] nvarchar(25) COLLATE Chinese_PRC_CI_AS  NULL,
    [LAST_MODIFIER_TIME] datetime2(7)  NULL,
    [LAST_MODIFIER_USER] nvarchar(25) COLLATE Chinese_PRC_CI_AS  NULL
    )
    GO

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

    EXEC sp_addextendedproperty
    'MS_Description', N'组织ID',
    'SCHEMA', N'dbo',
    'TABLE', N'dqms_rating_result',
    'COLUMN', N'ORG_ID'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'组织名',
    'SCHEMA', N'dbo',
    'TABLE', N'dqms_rating_result',
    'COLUMN', N'ORG_NAME'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'组织等级',
    'SCHEMA', N'dbo',
    'TABLE', N'dqms_rating_result',
    'COLUMN', N'ORG_LEVEL'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'父组织ID',
    'SCHEMA', N'dbo',
    'TABLE', N'dqms_rating_result',
    'COLUMN', N'PARENT_ORG_ID'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'得分',
    'SCHEMA', N'dbo',
    'TABLE', N'dqms_rating_result',
    'COLUMN', N'SCORE'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'评估开始日期',
    'SCHEMA', N'dbo',
    'TABLE', N'dqms_rating_result',
    'COLUMN', N'START_DATE'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'评估截至日期',
    'SCHEMA', N'dbo',
    'TABLE', N'dqms_rating_result',
    'COLUMN', N'END_DATE'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'评分周期 年（year）、季度（quarter）、月（month）、周（week），默认月',
    'SCHEMA', N'dbo',
    'TABLE', N'dqms_rating_result',
    'COLUMN', N'RATING_CYCLE'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'评分点 例如：2023-01',
    'SCHEMA', N'dbo',
    'TABLE', N'dqms_rating_result',
    'COLUMN', N'RATING_POINT'
    GO


    -- ----------------------------
-- Records of dqms_rating_result
-- ----------------------------

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

CREATE TABLE [dbo].[ds_data_config_mgr] (
    [SID] bigint  NOT NULL,
    [CONFIGCODE] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NOT NULL,
    [CONFIGNAME] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NOT NULL,
    [CONFIGTYPE] nvarchar(25) COLLATE Chinese_PRC_CI_AS  NOT NULL,
    [USERKEYTABFILE] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [KRB5FILE] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [HIVECLIENTPROPFILE] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [HDFSSITEFILE] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [CORESITEFILE] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [HBASESITEFILE] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [DESCRIPTION] nvarchar(500) COLLATE Chinese_PRC_CI_AS  NULL,
    [CREATE_BY] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [CREATE_TIME] datetime2(7)  NULL,
    [UPDATE_BY] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [UPDATE_TIME] datetime2(7)  NULL,
    [PATH_TYPE] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [SFTP_PATH] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL
    )
    GO

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

    EXEC sp_addextendedproperty
    'MS_Description', N'LOCAL/SFTP',
    'SCHEMA', N'dbo',
    'TABLE', N'ds_data_config_mgr',
    'COLUMN', N'PATH_TYPE'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'SFTP的路径',
    'SCHEMA', N'dbo',
    'TABLE', N'ds_data_config_mgr',
    'COLUMN', N'SFTP_PATH'
    GO


    -- ----------------------------
-- Records of ds_data_config_mgr
-- ----------------------------

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

CREATE TABLE [dbo].[ds_data_source] (
    [SID] bigint  NOT NULL,
    [DATA_SOURCE_NAME] nvarchar(300) COLLATE Chinese_PRC_CI_AS  NULL,
    [URL] nvarchar(1000) COLLATE Chinese_PRC_CI_AS  NULL,
    [DRIVER] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
    [USER_NAME] nvarchar(60) COLLATE Chinese_PRC_CI_AS  NULL,
    [PWD] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [SOURCE] nvarchar(10) COLLATE Chinese_PRC_CI_AS  NULL,
    [CREATE_BY] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [CREATE_TIME] datetime2(7)  NULL,
    [UPDATE_BY] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [UPDATE_TIME] datetime2(7)  NULL,
    [DATA_SOURCE_CODE] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [METACUBE_DEFINE_NAME] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [DATASOURCE_TYPE] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
    [CONFIGMGR_SID] nvarchar(65) COLLATE Chinese_PRC_CI_AS  NULL
    )
    GO

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

    EXEC sp_addextendedproperty
    'MS_Description', N'数据源名称',
    'SCHEMA', N'dbo',
    'TABLE', N'ds_data_source',
    'COLUMN', N'DATA_SOURCE_NAME'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'数据源来源：1：元数据:2：自建:3：同步',
    'SCHEMA', N'dbo',
    'TABLE', N'ds_data_source',
    'COLUMN', N'SOURCE'
    GO


    -- ----------------------------
-- Records of ds_data_source
-- ----------------------------

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

CREATE TABLE [dbo].[ds_hbase_mappping] (
    [sid] bigint  NOT NULL,
    [hive_ds_id] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
    [hive_ds_name] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
    [hive_db_name] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
    [hive_table] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
    [hbase_ds_id] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
    [hbase_ds_name] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
    [hbase_namespace] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
    [hbase_table] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
    [storage_type] nvarchar(20) COLLATE Chinese_PRC_CI_AS  NULL,
    [column_mappings] nvarchar(max) COLLATE Chinese_PRC_CI_AS  NULL,
    [serde_properties] nvarchar(max) COLLATE Chinese_PRC_CI_AS  NULL,
    [tbl_properties] nvarchar(1024) COLLATE Chinese_PRC_CI_AS  NULL,
    [create_time] datetime2(7)  NULL,
    [create_by] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [update_time] datetime2(7)  NULL,
    [update_by] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL
    )
    GO

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

    EXEC sp_addextendedproperty
    'MS_Description', N'HBase映射表管理',
    'SCHEMA', N'dbo',
    'TABLE', N'ds_hbase_mappping'
    GO


    -- ----------------------------
-- Records of ds_hbase_mappping
-- ----------------------------

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

CREATE TABLE [dbo].[ds_resource_info] (
    [TABLE_TAG] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [SID] bigint  NOT NULL,
    [RESOURCE_CODE] nvarchar(64) COLLATE Chinese_PRC_CI_AS  NULL,
    [RESOURCE_NAME] nvarchar(2000) COLLATE Chinese_PRC_CI_AS  NULL,
    [DIRECTORY_CODE] nvarchar(64) COLLATE Chinese_PRC_CI_AS  NULL,
    [DIRECTORY_NAME] nvarchar(2000) COLLATE Chinese_PRC_CI_AS  NULL,
    [AUTHORITY_UNIT] nvarchar(128) COLLATE Chinese_PRC_CI_AS  NULL,
    [SOURCE_TYPE] bigint  NULL,
    [OBTAIN_WAY] bigint  NULL,
    [APP_SYSTEM] nvarchar(128) COLLATE Chinese_PRC_CI_AS  NULL,
    [MANAGE_UNIT] nvarchar(128) COLLATE Chinese_PRC_CI_AS  NULL,
    [DATA_LOCATION] nvarchar(32) COLLATE Chinese_PRC_CI_AS  NULL,
    [STORAGE_CENTER] nvarchar(32) COLLATE Chinese_PRC_CI_AS  NULL,
    [STATUS] nchar(1) COLLATE Chinese_PRC_CI_AS  NULL,
    [DESCRIPTION] nvarchar(2000) COLLATE Chinese_PRC_CI_AS  NULL,
    [STORAGE_SCALE] nvarchar(128) COLLATE Chinese_PRC_CI_AS  NULL,
    [STORAGE_CYCLE] nvarchar(128) COLLATE Chinese_PRC_CI_AS  NULL,
    [UPDATE_CYCLE] nvarchar(128) COLLATE Chinese_PRC_CI_AS  NULL,
    [UPDATE_SCALE] nvarchar(128) COLLATE Chinese_PRC_CI_AS  NULL,
    [DATA_UPDATE_TIME] datetime2(7)  NULL,
    [REGISTER_TIME] datetime2(7)  NULL,
    [META_DIR_CODE] nvarchar(128) COLLATE Chinese_PRC_CI_AS  NULL,
    [SCHEMA_CODE] nvarchar(128) COLLATE Chinese_PRC_CI_AS  NULL,
    [TABLE_CODE] nvarchar(128) COLLATE Chinese_PRC_CI_AS  NULL,
    [CREATE_BY] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [CREATE_TIME] datetime2(7)  NULL,
    [UPDATE_BY] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [UPDATE_TIME] datetime2(7)  NULL,
    [DATA_SOURCE_NAME] nvarchar(300) COLLATE Chinese_PRC_CI_AS  NULL,
    [RESOURCE_TYPE] nvarchar(20) COLLATE Chinese_PRC_CI_AS  NULL,
    [INIT_SOLR] nchar(1) COLLATE Chinese_PRC_CI_AS  NULL,
    [DATA_ORGANIZATION] bigint  NULL,
    [LABEL_1] bigint  NULL,
    [LABEL_2] bigint  NULL,
    [LABEL_3] bigint  NULL,
    [LABEL_4] bigint  NULL,
    [LABEL_5] bigint  NULL,
    [INSTANCE_ID] nvarchar(128) COLLATE Chinese_PRC_CI_AS  NULL,
    [ISPEAT] nvarchar(64) COLLATE Chinese_PRC_CI_AS  NULL,
    [TABLEDESC] nvarchar(max) COLLATE Chinese_PRC_CI_AS  NULL,
    [DATAMODE] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [WHYREPEAT] nvarchar(500) COLLATE Chinese_PRC_CI_AS  NULL,
    [DIFFERSERV] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [TABLE_RECORD] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [MAPPING_NUMBER] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
    [MAPPING_FIELD] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
    [DATA_TABLE_NUM] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [DEPLOY_TYPE] nvarchar(300) COLLATE Chinese_PRC_CI_AS  NULL,
    [LAST_UPDATE_TIME] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
    [FUNCTION_TEMPLATE] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [SUB_FUNCTION_TEMPLATE] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [IS_ACCESS] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [mainDataId] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
    [WHY_NEGATIVELIST] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [IS_NEGATIVELIST] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [ID] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
    [mainTableId] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
    [busi_type_num] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
    [topic_num] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
    [TABLE_NAMESPACE] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [TABLE_NAME] nvarchar(512) COLLATE Chinese_PRC_CI_AS  NULL,
    [principal] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL
    )
    GO

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

    EXEC sp_addextendedproperty
    'MS_Description', N'状态:  4已发布',
    'SCHEMA', N'dbo',
    'TABLE', N'ds_resource_info',
    'COLUMN', N'STATUS'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'资源关联的表所在目录编码',
    'SCHEMA', N'dbo',
    'TABLE', N'ds_resource_info',
    'COLUMN', N'META_DIR_CODE'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'资源关联的表所在库编码',
    'SCHEMA', N'dbo',
    'TABLE', N'ds_resource_info',
    'COLUMN', N'SCHEMA_CODE'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'资源关联的表编码',
    'SCHEMA', N'dbo',
    'TABLE', N'ds_resource_info',
    'COLUMN', N'TABLE_CODE'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'数据源名称',
    'SCHEMA', N'dbo',
    'TABLE', N'ds_resource_info',
    'COLUMN', N'DATA_SOURCE_NAME'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'是否已加入solr',
    'SCHEMA', N'dbo',
    'TABLE', N'ds_resource_info',
    'COLUMN', N'INIT_SOLR'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'数组组织ID',
    'SCHEMA', N'dbo',
    'TABLE', N'ds_resource_info',
    'COLUMN', N'DATA_ORGANIZATION'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'数组组织-标签1ID',
    'SCHEMA', N'dbo',
    'TABLE', N'ds_resource_info',
    'COLUMN', N'LABEL_1'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'数组组织-标签2ID',
    'SCHEMA', N'dbo',
    'TABLE', N'ds_resource_info',
    'COLUMN', N'LABEL_2'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'数组组织-标签3ID',
    'SCHEMA', N'dbo',
    'TABLE', N'ds_resource_info',
    'COLUMN', N'LABEL_3'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'数组组织-标签4ID',
    'SCHEMA', N'dbo',
    'TABLE', N'ds_resource_info',
    'COLUMN', N'LABEL_4'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'数组组织-标签5ID',
    'SCHEMA', N'dbo',
    'TABLE', N'ds_resource_info',
    'COLUMN', N'LABEL_5'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'是否重复',
    'SCHEMA', N'dbo',
    'TABLE', N'ds_resource_info',
    'COLUMN', N'ISPEAT'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'数据生成方式',
    'SCHEMA', N'dbo',
    'TABLE', N'ds_resource_info',
    'COLUMN', N'DATAMODE'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'重复原因',
    'SCHEMA', N'dbo',
    'TABLE', N'ds_resource_info',
    'COLUMN', N'WHYREPEAT'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'责任人',
    'SCHEMA', N'dbo',
    'TABLE', N'ds_resource_info',
    'COLUMN', N'principal'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'存储数据资源基本信息，如数据名称等，与元数据的表对应',
    'SCHEMA', N'dbo',
    'TABLE', N'ds_resource_info'
    GO


    -- ----------------------------
-- Records of ds_resource_info
-- ----------------------------

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

CREATE TABLE [dbo].[ds_resource_item] (
    [SID] bigint  NOT NULL,
    [RESOURCE_SID] bigint  NULL,
    [ITEM_CODE] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
    [ITEM_NAME] nvarchar(2000) COLLATE Chinese_PRC_CI_AS  NULL,
    [IS_QUERY] nchar(1) COLLATE Chinese_PRC_CI_AS  NULL,
    [QUERY_MATCH_TYPE] nvarchar(128) COLLATE Chinese_PRC_CI_AS  NULL,
    [IS_SUBSCRIBE] nchar(1) COLLATE Chinese_PRC_CI_AS  NULL,
    [SUBSCRIBE_MATCH_TYPE] nvarchar(128) COLLATE Chinese_PRC_CI_AS  NULL,
    [CREATE_BY] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [CREATE_TIME] datetime2(7)  NULL,
    [UPDATE_BY] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [UPDATE_TIME] datetime2(7)  NULL,
    [INSTANCE_ID] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [SYNCDATE] datetime2(7)  NULL,
    [SEQ] bigint  NULL,
    [ITEM_TYPE] nvarchar(500) COLLATE Chinese_PRC_CI_AS  NULL,
    [INSTANCE_CODE] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [INSTANCE_NAME] nvarchar(2000) COLLATE Chinese_PRC_CI_AS  NULL,
    [COMMENTS] nvarchar(max) COLLATE Chinese_PRC_CI_AS  NULL,
    [IS_PK] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [IS_UNIQUE] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [IS_FK] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [IS_NULLABLE] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [COLLENGTHS] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [SCALES] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [INITIAL_VALUE] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [IS_SHARE] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [IS_MASKING] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [DATA_TYPE] nvarchar(500) COLLATE Chinese_PRC_CI_AS  NULL,
    [WHY_SHARE] nvarchar(2000) COLLATE Chinese_PRC_CI_AS  NULL,
    [DESEN_RULE] nvarchar(500) COLLATE Chinese_PRC_CI_AS  NULL,
    [STD_CODE] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [STORAGE_FORMAT] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [IS_BASE] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [SOURCE_SYSTEM] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [OWN_USER] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [SOURCE_TB_EN] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [SOURCE_TB_CN] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [SOURCE_TB_DESC] nvarchar(max) COLLATE Chinese_PRC_CI_AS  NULL,
    [SOURCE_COL_EN] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [SOURCE_COL_CN] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [SOURCE_COL_DESC] nvarchar(max) COLLATE Chinese_PRC_CI_AS  NULL,
    [REB_DEPT] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [BUS_DEPT_IS_CFM] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [DATA_IS_CFM] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [LATEST_VER_NO] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [LATEST_REVISION_NO] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [CONSTRAINTS_KEY] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [status] nvarchar(10) COLLATE Chinese_PRC_CI_AS  NULL,
    [ID] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
    [mainTableId] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
    [mainDataId] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
    [SOURCE_COL_TYPE] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
    [principal] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL
    )
    GO

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

    EXEC sp_addextendedproperty
    'MS_Description', N'元数据id',
    'SCHEMA', N'dbo',
    'TABLE', N'ds_resource_item',
    'COLUMN', N'INSTANCE_ID'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'元数据同步时间',
    'SCHEMA', N'dbo',
    'TABLE', N'ds_resource_item',
    'COLUMN', N'SYNCDATE'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'字段英文名',
    'SCHEMA', N'dbo',
    'TABLE', N'ds_resource_item',
    'COLUMN', N'INSTANCE_CODE'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'中文名',
    'SCHEMA', N'dbo',
    'TABLE', N'ds_resource_item',
    'COLUMN', N'INSTANCE_NAME'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'描述，注释',
    'SCHEMA', N'dbo',
    'TABLE', N'ds_resource_item',
    'COLUMN', N'COMMENTS'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'是否主键',
    'SCHEMA', N'dbo',
    'TABLE', N'ds_resource_item',
    'COLUMN', N'IS_PK'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'是否唯一键',
    'SCHEMA', N'dbo',
    'TABLE', N'ds_resource_item',
    'COLUMN', N'IS_UNIQUE'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'是否外键',
    'SCHEMA', N'dbo',
    'TABLE', N'ds_resource_item',
    'COLUMN', N'IS_FK'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'是否为空',
    'SCHEMA', N'dbo',
    'TABLE', N'ds_resource_item',
    'COLUMN', N'IS_NULLABLE'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'长度',
    'SCHEMA', N'dbo',
    'TABLE', N'ds_resource_item',
    'COLUMN', N'COLLENGTHS'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'小数位',
    'SCHEMA', N'dbo',
    'TABLE', N'ds_resource_item',
    'COLUMN', N'SCALES'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'默认值',
    'SCHEMA', N'dbo',
    'TABLE', N'ds_resource_item',
    'COLUMN', N'INITIAL_VALUE'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'是否有条件共享',
    'SCHEMA', N'dbo',
    'TABLE', N'ds_resource_item',
    'COLUMN', N'IS_SHARE'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'是否脱敏',
    'SCHEMA', N'dbo',
    'TABLE', N'ds_resource_item',
    'COLUMN', N'IS_MASKING'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'数据类型',
    'SCHEMA', N'dbo',
    'TABLE', N'ds_resource_item',
    'COLUMN', N'DATA_TYPE'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'不能共享原因',
    'SCHEMA', N'dbo',
    'TABLE', N'ds_resource_item',
    'COLUMN', N'WHY_SHARE'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'脱敏规则',
    'SCHEMA', N'dbo',
    'TABLE', N'ds_resource_item',
    'COLUMN', N'DESEN_RULE'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'标准编码',
    'SCHEMA', N'dbo',
    'TABLE', N'ds_resource_item',
    'COLUMN', N'STD_CODE'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'存储格式',
    'SCHEMA', N'dbo',
    'TABLE', N'ds_resource_item',
    'COLUMN', N'STORAGE_FORMAT'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'是否基线版',
    'SCHEMA', N'dbo',
    'TABLE', N'ds_resource_item',
    'COLUMN', N'IS_BASE'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'来源系统',
    'SCHEMA', N'dbo',
    'TABLE', N'ds_resource_item',
    'COLUMN', N'SOURCE_SYSTEM'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'所属用户',
    'SCHEMA', N'dbo',
    'TABLE', N'ds_resource_item',
    'COLUMN', N'OWN_USER'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'源表英文名',
    'SCHEMA', N'dbo',
    'TABLE', N'ds_resource_item',
    'COLUMN', N'SOURCE_TB_EN'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'源表中文名',
    'SCHEMA', N'dbo',
    'TABLE', N'ds_resource_item',
    'COLUMN', N'SOURCE_TB_CN'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'源表字段英文',
    'SCHEMA', N'dbo',
    'TABLE', N'ds_resource_item',
    'COLUMN', N'SOURCE_COL_EN'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'源字段中文名',
    'SCHEMA', N'dbo',
    'TABLE', N'ds_resource_item',
    'COLUMN', N'SOURCE_COL_CN'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'责任部门',
    'SCHEMA', N'dbo',
    'TABLE', N'ds_resource_item',
    'COLUMN', N'REB_DEPT'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'业务部门是否确认',
    'SCHEMA', N'dbo',
    'TABLE', N'ds_resource_item',
    'COLUMN', N'BUS_DEPT_IS_CFM'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'数据是否落地',
    'SCHEMA', N'dbo',
    'TABLE', N'ds_resource_item',
    'COLUMN', N'DATA_IS_CFM'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'最新版本号',
    'SCHEMA', N'dbo',
    'TABLE', N'ds_resource_item',
    'COLUMN', N'LATEST_VER_NO'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'最终修订版本号',
    'SCHEMA', N'dbo',
    'TABLE', N'ds_resource_item',
    'COLUMN', N'LATEST_REVISION_NO'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'约束键',
    'SCHEMA', N'dbo',
    'TABLE', N'ds_resource_item',
    'COLUMN', N'CONSTRAINTS_KEY'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'责任人',
    'SCHEMA', N'dbo',
    'TABLE', N'ds_resource_item',
    'COLUMN', N'principal'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'存储数据资源项信息，与元数据的列对应，其与数据资源信息表对应关系为多对1',
    'SCHEMA', N'dbo',
    'TABLE', N'ds_resource_item'
    GO


    -- ----------------------------
-- Records of ds_resource_item
-- ----------------------------

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

CREATE TABLE [dbo].[po_feedback] (
    [SID] bigint  NOT NULL,
    [OPTIONID] bigint  NOT NULL,
    [USERNAME] nvarchar(32) COLLATE Chinese_PRC_CI_AS  NOT NULL,
    [FEEDBACK] nvarchar(max) COLLATE Chinese_PRC_CI_AS  NOT NULL,
    [CREATE_BY] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [UPDATE_BY] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [CREATE_TIME] datetime2(7)  NULL,
    [UPDATE_TIME] datetime2(7)  NULL
    )
    GO

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

    EXEC sp_addextendedproperty
    'MS_Description', N'创建时的userid',
    'SCHEMA', N'dbo',
    'TABLE', N'po_feedback',
    'COLUMN', N'CREATE_BY'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'最后一次修改者的userid',
    'SCHEMA', N'dbo',
    'TABLE', N'po_feedback',
    'COLUMN', N'UPDATE_BY'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'最后一次修改该记录的时间',
    'SCHEMA', N'dbo',
    'TABLE', N'po_feedback',
    'COLUMN', N'UPDATE_TIME'
    GO


    -- ----------------------------
-- Records of po_feedback
-- ----------------------------

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

CREATE TABLE [dbo].[po_files] (
    [SID] bigint  NOT NULL,
    [RELID] bigint  NULL,
    [FILENAME] nvarchar(64) COLLATE Chinese_PRC_CI_AS  NOT NULL,
    [ACTUALFILENAME] nvarchar(64) COLLATE Chinese_PRC_CI_AS  NOT NULL,
    [FILEPATH] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [CREATE_BY] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [UPDATE_BY] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [CREATE_TIME] datetime2(7)  NULL,
    [UPDATE_TIME] datetime2(7)  NULL
    )
    GO

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

    EXEC sp_addextendedproperty
    'MS_Description', N'附件所关联的对象ID',
    'SCHEMA', N'dbo',
    'TABLE', N'po_files',
    'COLUMN', N'RELID'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'可以使用 http://ip:port/files/文件名称 访问上传路径下的文件',
    'SCHEMA', N'dbo',
    'TABLE', N'po_files',
    'COLUMN', N'FILEPATH'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'创建时的userid',
    'SCHEMA', N'dbo',
    'TABLE', N'po_files',
    'COLUMN', N'CREATE_BY'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'最后一次修改者的userid',
    'SCHEMA', N'dbo',
    'TABLE', N'po_files',
    'COLUMN', N'UPDATE_BY'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'最后一次修改该记录的时间',
    'SCHEMA', N'dbo',
    'TABLE', N'po_files',
    'COLUMN', N'UPDATE_TIME'
    GO


    -- ----------------------------
-- Records of po_files
-- ----------------------------

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

CREATE TABLE [dbo].[po_options] (
    [SID] bigint  NOT NULL,
    [TITLE] nvarchar(32) COLLATE Chinese_PRC_CI_AS  NOT NULL,
    [SOURCE] nvarchar(32) COLLATE Chinese_PRC_CI_AS  NOT NULL,
    [DATARESOURCE] nvarchar(32) COLLATE Chinese_PRC_CI_AS  NULL,
    [FIELD] nvarchar(32) COLLATE Chinese_PRC_CI_AS  NULL,
    [DESCRIPTION] nvarchar(max) COLLATE Chinese_PRC_CI_AS  NOT NULL,
    [STATUS] nchar(1) COLLATE Chinese_PRC_CI_AS  NOT NULL,
    [USERNAME] nvarchar(32) COLLATE Chinese_PRC_CI_AS  NOT NULL,
    [CREATE_BY] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [UPDATE_BY] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [CREATE_TIME] datetime2(7)  NULL,
    [UPDATE_TIME] datetime2(7)  NULL,
    [CONTACTINFO] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL
    )
    GO

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

    EXEC sp_addextendedproperty
    'MS_Description', N'来源于静态参数 存静态参数的ID 有   质量检核  隐患  用户反馈 其他途径',
    'SCHEMA', N'dbo',
    'TABLE', N'po_options',
    'COLUMN', N'SOURCE'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'0  未反馈 1  已反馈 9  已关闭',
    'SCHEMA', N'dbo',
    'TABLE', N'po_options',
    'COLUMN', N'STATUS'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'创建时的userid',
    'SCHEMA', N'dbo',
    'TABLE', N'po_options',
    'COLUMN', N'CREATE_BY'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'最后一次修改者的userid',
    'SCHEMA', N'dbo',
    'TABLE', N'po_options',
    'COLUMN', N'UPDATE_BY'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'最后一次修改该记录的时间',
    'SCHEMA', N'dbo',
    'TABLE', N'po_options',
    'COLUMN', N'UPDATE_TIME'
    GO


    -- ----------------------------
-- Records of po_options
-- ----------------------------


-- ----------------------------
-- Primary Key structure for table ck_alarm_config
-- ----------------------------
ALTER TABLE [dbo].[ck_alarm_config] ADD CONSTRAINT [PK__ck_alarm__CA19597075C8EC6A] PRIMARY KEY CLUSTERED ([SID])
    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 ck_alarm_record
-- ----------------------------
ALTER TABLE [dbo].[ck_alarm_record] ADD CONSTRAINT [PK__ck_alarm__CA1959705FCCD9C3] PRIMARY KEY CLUSTERED ([SID])
    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 ck_calendar
-- ----------------------------
ALTER TABLE [dbo].[ck_calendar] ADD CONSTRAINT [PK__ck_calen__C36D020C0A0F5837] PRIMARY KEY CLUSTERED ([CK_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 ck_check_log
-- ----------------------------
CREATE UNIQUE NONCLUSTERED INDEX [SID]
ON [dbo].[ck_check_log] (
  [SID] ASC
)
WITH (
  STATISTICS_NORECOMPUTE = ON
)
GO

CREATE NONCLUSTERED INDEX [JOB_LOG_ID]
ON [dbo].[ck_check_log] (
  [JOB_LOG_ID] ASC
)
WITH (
  STATISTICS_NORECOMPUTE = ON
)
GO

CREATE NONCLUSTERED INDEX [METHOD_CONFIG_ID]
ON [dbo].[ck_check_log] (
  [METHOD_CONFIG_ID] ASC
)
WITH (
  STATISTICS_NORECOMPUTE = ON
)
GO


-- ----------------------------
-- Primary Key structure for table ck_check_log
-- ----------------------------
ALTER TABLE [dbo].[ck_check_log] ADD CONSTRAINT [PK__ck_check__CA19597090278B85] PRIMARY KEY CLUSTERED ([SID])
    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 ck_check_log_latest
-- ----------------------------
ALTER TABLE [dbo].[ck_check_log_latest] ADD CONSTRAINT [PK__ck_check__634AF3038C15769F] PRIMARY KEY CLUSTERED ([METHOD_CONFIG_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 ck_check_result
-- ----------------------------
CREATE UNIQUE NONCLUSTERED INDEX [SID]
ON [dbo].[ck_check_result] (
  [SID] ASC
)
WITH (
  STATISTICS_NORECOMPUTE = ON
)
GO

CREATE NONCLUSTERED INDEX [JOB_LOG_ID]
ON [dbo].[ck_check_result] (
  [JOB_LOG_ID] ASC
)
WITH (
  STATISTICS_NORECOMPUTE = ON
)
GO

CREATE NONCLUSTERED INDEX [METHOD_CONFIG_ID]
ON [dbo].[ck_check_result] (
  [METHOD_CONFIG_ID] ASC
)
WITH (
  STATISTICS_NORECOMPUTE = ON
)
GO

CREATE NONCLUSTERED INDEX [index_ck_check_result]
ON [dbo].[ck_check_result] (
  [CHECK_TIME] ASC
)
WITH (
  STATISTICS_NORECOMPUTE = ON
)
GO

CREATE NONCLUSTERED INDEX [index_ck_check_result_method_config_id]
ON [dbo].[ck_check_result] (
  [METHOD_CONFIG_ID] ASC
)
WITH (
  STATISTICS_NORECOMPUTE = ON
)
GO


-- ----------------------------
-- Primary Key structure for table ck_check_result
-- ----------------------------
ALTER TABLE [dbo].[ck_check_result] ADD CONSTRAINT [PK__ck_check__CA19597014C8E78C] PRIMARY KEY CLUSTERED ([SID])
    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 ck_check_result_latest
-- ----------------------------
ALTER TABLE [dbo].[ck_check_result_latest] ADD CONSTRAINT [PK__ck_check__634AF303A6C7C90A] PRIMARY KEY CLUSTERED ([METHOD_CONFIG_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 ck_frequency
-- ----------------------------
ALTER TABLE [dbo].[ck_frequency] ADD CONSTRAINT [PK__ck_frequ__D9C1FA013CEF6CB4] PRIMARY KEY CLUSTERED ([NAME])
    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 ck_general_config
-- ----------------------------
ALTER TABLE [dbo].[ck_general_config] ADD CONSTRAINT [PK__ck_gener__CA19597089484EAA] PRIMARY KEY CLUSTERED ([SID])
    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 ck_general_config_detail
-- ----------------------------
ALTER TABLE [dbo].[ck_general_config_detail] ADD CONSTRAINT [PK__ck_gener__CA195970570B66F4] PRIMARY KEY CLUSTERED ([SID])
    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 ck_general_result
-- ----------------------------
ALTER TABLE [dbo].[ck_general_result] ADD CONSTRAINT [PK__ck_gener__CA1959708D240DEB] PRIMARY KEY CLUSTERED ([SID])
    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 ck_general_result_detail
-- ----------------------------
ALTER TABLE [dbo].[ck_general_result_detail] ADD CONSTRAINT [PK__ck_gener__CA19597044E7A8E4] PRIMARY KEY CLUSTERED ([SID])
    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 ck_group
-- ----------------------------
CREATE NONCLUSTERED INDEX [INDEX_CK_GROUP_UPPERGROUP]
ON [dbo].[ck_group] (
  [GROUP_NAME] ASC
)
WITH (
  STATISTICS_NORECOMPUTE = ON
)
GO


-- ----------------------------
-- Primary Key structure for table ck_group
-- ----------------------------
ALTER TABLE [dbo].[ck_group] ADD CONSTRAINT [PK__ck_group__CA19597016349F7A] PRIMARY KEY CLUSTERED ([SID])
    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 ck_group_relation
-- ----------------------------
ALTER TABLE [dbo].[ck_group_relation] ADD CONSTRAINT [PK__ck_group__D62A63561F690003] PRIMARY KEY CLUSTERED ([CONFIGSID], [CONFIGTYPE])
    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 ck_index_info
-- ----------------------------
ALTER TABLE [dbo].[ck_index_info] ADD CONSTRAINT [PK__ck_index__CA1959708DCB8750] PRIMARY KEY CLUSTERED ([SID])
    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 ck_index_weight_info
-- ----------------------------
ALTER TABLE [dbo].[ck_index_weight_info] ADD CONSTRAINT [PK__ck_index__CA195970788DBEF5] PRIMARY KEY CLUSTERED ([SID])
    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 ck_knowledge_info
-- ----------------------------
ALTER TABLE [dbo].[ck_knowledge_info] ADD CONSTRAINT [PK__ck_knowl__CA1959707D764B70] PRIMARY KEY CLUSTERED ([SID])
    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 ck_method_config
-- ----------------------------
CREATE NONCLUSTERED INDEX [index_ck_method_config]
ON [dbo].[ck_method_config] (
  [RESOURCE_ID] ASC
)
WITH (
  STATISTICS_NORECOMPUTE = ON
)
GO

CREATE NONCLUSTERED INDEX [index_ck_method_config1]
ON [dbo].[ck_method_config] (
  [DELETED] ASC
)
WITH (
  STATISTICS_NORECOMPUTE = ON
)
GO


-- ----------------------------
-- Primary Key structure for table ck_method_config
-- ----------------------------
ALTER TABLE [dbo].[ck_method_config] ADD CONSTRAINT [PK__ck_metho__CA1959706C20BBB2] PRIMARY KEY CLUSTERED ([SID])
    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 ck_method_config_course
-- ----------------------------
ALTER TABLE [dbo].[ck_method_config_course] ADD CONSTRAINT [PK__ck_metho__CA195970374CE9E1] PRIMARY KEY CLUSTERED ([SID])
    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 ck_method_item
-- ----------------------------
ALTER TABLE [dbo].[ck_method_item] ADD CONSTRAINT [PK__ck_metho__CA1959703CC8DA9B] PRIMARY KEY CLUSTERED ([SID])
    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 ck_result_detail
-- ----------------------------
ALTER TABLE [dbo].[ck_result_detail] ADD CONSTRAINT [PK__ck_resul__CA19597054BF5E7C] PRIMARY KEY CLUSTERED ([SID])
    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 ck_result_options
-- ----------------------------
ALTER TABLE [dbo].[ck_result_options] ADD CONSTRAINT [PK__ck_resul__CA195970FC17766B] PRIMARY KEY CLUSTERED ([SID])
    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 ck_rule_info
-- ----------------------------
ALTER TABLE [dbo].[ck_rule_info] ADD CONSTRAINT [PK__ck_rule___CA195970A3AED80C] PRIMARY KEY CLUSTERED ([SID])
    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 ck_schedule_config
-- ----------------------------
CREATE NONCLUSTERED INDEX [I_job_id1]
ON [dbo].[ck_schedule_config] (
  [JOB_ID] ASC
)
WITH (
  STATISTICS_NORECOMPUTE = ON
)
GO


-- ----------------------------
-- Primary Key structure for table ck_schedule_config
-- ----------------------------
ALTER TABLE [dbo].[ck_schedule_config] ADD CONSTRAINT [PK__ck_sched__CA195970A7E11749] PRIMARY KEY CLUSTERED ([SID])
    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 cl_classif_info
-- ----------------------------
CREATE UNIQUE NONCLUSTERED INDEX [IDEX_CLS_SEQ]
ON [dbo].[cl_classif_info] (
  [SEQ] ASC
)
WITH (
  STATISTICS_NORECOMPUTE = ON
)
GO

CREATE NONCLUSTERED INDEX [IDEX_CLS_UPPERCLASSIF]
ON [dbo].[cl_classif_info] (
  [UPPER_CLASSIF] ASC
)
WITH (
  STATISTICS_NORECOMPUTE = ON
)
GO


-- ----------------------------
-- Primary Key structure for table cl_classif_info
-- ----------------------------
ALTER TABLE [dbo].[cl_classif_info] ADD CONSTRAINT [PK__cl_class__CA19597000F456C9] PRIMARY KEY CLUSTERED ([SID])
    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 cl_data_classif
-- ----------------------------
CREATE NONCLUSTERED INDEX [IDX_CDC_CLASSIF_SID]
ON [dbo].[cl_data_classif] (
  [CLASSIF_SID] ASC
)
WITH (
  STATISTICS_NORECOMPUTE = ON
)
GO

CREATE NONCLUSTERED INDEX [IDX_CDC_RESOURCE_ID]
ON [dbo].[cl_data_classif] (
  [RESOURCE_ID] ASC
)
WITH (
  STATISTICS_NORECOMPUTE = ON
)
GO


-- ----------------------------
-- Primary Key structure for table cl_data_classif
-- ----------------------------
ALTER TABLE [dbo].[cl_data_classif] ADD CONSTRAINT [PK__cl_data___E9A77C4E146958F7] PRIMARY KEY CLUSTERED ([RESOURCE_ID], [CLASSIF_SID])
    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 cl_data_level
-- ----------------------------
ALTER TABLE [dbo].[cl_data_level] ADD CONSTRAINT [PK__cl_data___2ADCF63EC525F5F7] PRIMARY KEY CLUSTERED ([RESOURCE_SID], [LEVEL_SID])
    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 cl_level_info
-- ----------------------------
ALTER TABLE [dbo].[cl_level_info] ADD CONSTRAINT [PK__cl_level__CA195970D33DFE1F] PRIMARY KEY CLUSTERED ([SID])
    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 cl_resouce_count
-- ----------------------------
ALTER TABLE [dbo].[cl_resouce_count] ADD CONSTRAINT [PK__cl_resou__DDDFDD3686E4AB34] PRIMARY KEY CLUSTERED ([sid])
    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 cl_resouce_count_temp
-- ----------------------------
ALTER TABLE [dbo].[cl_resouce_count_temp] ADD CONSTRAINT [PK__cl_resou__DDDFDD3690977B88] PRIMARY KEY CLUSTERED ([sid])
    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 cl_role_classif
-- ----------------------------
ALTER TABLE [dbo].[cl_role_classif] ADD CONSTRAINT [PK__cl_role___E3BBBEC781F457AD] PRIMARY KEY CLUSTERED ([ROLE_SID], [CLASSIF_SID])
    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 cl_role_level
-- ----------------------------
ALTER TABLE [dbo].[cl_role_level] ADD CONSTRAINT [PK__cl_role___7C6DFEF1C083502C] PRIMARY KEY CLUSTERED ([ROLE_SID], [LEVEL_SID])
    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 cof_dict_entry
-- ----------------------------
CREATE NONCLUSTERED INDEX [COF_DICT_ENTRY_INDEX_CODE]
ON [dbo].[cof_dict_entry] (
  [CODE] ASC
)
WITH (
  STATISTICS_NORECOMPUTE = ON
)
GO

CREATE NONCLUSTERED INDEX [COF_DICT_ENTRY_INDEX_NAME]
ON [dbo].[cof_dict_entry] (
  [NAME] ASC
)
WITH (
  STATISTICS_NORECOMPUTE = ON
)
GO

CREATE NONCLUSTERED INDEX [COF_DICT_ENTRY_INDEX_SEQ]
ON [dbo].[cof_dict_entry] (
  [SEQ] ASC
)
WITH (
  STATISTICS_NORECOMPUTE = ON
)
GO


-- ----------------------------
-- Primary Key structure for table cof_dict_entry
-- ----------------------------
ALTER TABLE [dbo].[cof_dict_entry] ADD CONSTRAINT [PK__cof_dict__3214EC2751E9008C] 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 cof_dict_type
-- ----------------------------
CREATE NONCLUSTERED INDEX [COF_DICT_TYPE_INDEX_CODE]
ON [dbo].[cof_dict_type] (
  [CODE] ASC
)
WITH (
  STATISTICS_NORECOMPUTE = ON
)
GO

CREATE NONCLUSTERED INDEX [COF_DICT_TYPE_INDEX_NAME]
ON [dbo].[cof_dict_type] (
  [NAME] ASC
)
WITH (
  STATISTICS_NORECOMPUTE = ON
)
GO

CREATE NONCLUSTERED INDEX [COF_DICT_TYPE_INDEX_SEQ]
ON [dbo].[cof_dict_type] (
  [SEQ] ASC
)
WITH (
  STATISTICS_NORECOMPUTE = ON
)
GO


-- ----------------------------
-- Primary Key structure for table cof_dict_type
-- ----------------------------
ALTER TABLE [dbo].[cof_dict_type] ADD CONSTRAINT [PK__cof_dict__3214EC27D8EA7488] 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 dqms_operation_log
-- ----------------------------
CREATE NONCLUSTERED INDEX [DQMS_OPERATION_LOG_INDEX_OPERATOR]
ON [dbo].[dqms_operation_log] (
  [OPERATOR_NAME] ASC
)
WITH (
  STATISTICS_NORECOMPUTE = ON
)
GO

CREATE NONCLUSTERED INDEX [DQMS_OPERATION_LOG_INDEX_OPERATE_TYPE]
ON [dbo].[dqms_operation_log] (
  [OPERATE_TYPE] ASC
)
WITH (
  STATISTICS_NORECOMPUTE = ON
)
GO

CREATE NONCLUSTERED INDEX [DQMS_OPERATION_LOG_INDEX_TARGET]
ON [dbo].[dqms_operation_log] (
  [TARGET_TYPE] ASC,
  [TARGET_MODEL_ID] ASC,
  [TARGET_MODEL_NAME] ASC
)
WITH (
  STATISTICS_NORECOMPUTE = ON
)
GO


-- ----------------------------
-- Primary Key structure for table dqms_operation_log
-- ----------------------------
ALTER TABLE [dbo].[dqms_operation_log] ADD CONSTRAINT [PK__dqms_ope__3214EC27BBB8EDFA] 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 dqms_operation_log_detail
-- ----------------------------
ALTER TABLE [dbo].[dqms_operation_log_detail] ADD CONSTRAINT [PK__dqms_ope__3214EC275DF61FF7] 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 dqms_rating_result
-- ----------------------------
ALTER TABLE [dbo].[dqms_rating_result] ADD CONSTRAINT [PK__dqms_rat__3214EC271963F385] 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 ds_data_config_mgr
-- ----------------------------
ALTER TABLE [dbo].[ds_data_config_mgr] ADD CONSTRAINT [PK__ds_data___CA1959705B1BF806] PRIMARY KEY CLUSTERED ([SID])
    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 ds_data_source
-- ----------------------------
ALTER TABLE [dbo].[ds_data_source] ADD CONSTRAINT [PK__ds_data___CA19597081815110] PRIMARY KEY CLUSTERED ([SID])
    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 ds_hbase_mappping
-- ----------------------------
ALTER TABLE [dbo].[ds_hbase_mappping] ADD CONSTRAINT [PK__ds_hbase__DDDFDD360AB650DA] PRIMARY KEY CLUSTERED ([sid])
    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 ds_resource_info
-- ----------------------------
CREATE NONCLUSTERED INDEX [IDX_DRI_DATAORGANIZATION]
ON [dbo].[ds_resource_info] (
  [DATA_ORGANIZATION] ASC
)
WITH (
  STATISTICS_NORECOMPUTE = ON
)
GO


-- ----------------------------
-- Primary Key structure for table ds_resource_info
-- ----------------------------
ALTER TABLE [dbo].[ds_resource_info] ADD CONSTRAINT [PK__ds_resou__CA195970201E1235] PRIMARY KEY CLUSTERED ([SID])
    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 ds_resource_item
-- ----------------------------
CREATE NONCLUSTERED INDEX [IDX_DSRI_RESOURCESID]
ON [dbo].[ds_resource_item] (
  [RESOURCE_SID] ASC
)
WITH (
  STATISTICS_NORECOMPUTE = ON
)
GO

CREATE NONCLUSTERED INDEX [IDX_DSRI_INSTANCEID]
ON [dbo].[ds_resource_item] (
  [INSTANCE_ID] ASC
)
WITH (
  STATISTICS_NORECOMPUTE = ON
)
GO


-- ----------------------------
-- Primary Key structure for table ds_resource_item
-- ----------------------------
ALTER TABLE [dbo].[ds_resource_item] ADD CONSTRAINT [PK__ds_resou__CA1959709436AC5E] PRIMARY KEY CLUSTERED ([SID])
    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 po_feedback
-- ----------------------------
ALTER TABLE [dbo].[po_feedback] ADD CONSTRAINT [PK__po_feedb__CA1959704E78D387] PRIMARY KEY CLUSTERED ([SID])
    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 po_files
-- ----------------------------
ALTER TABLE [dbo].[po_files] ADD CONSTRAINT [PK__po_files__CA195970F601B754] PRIMARY KEY CLUSTERED ([SID])
    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 po_options
-- ----------------------------
ALTER TABLE [dbo].[po_options] ADD CONSTRAINT [PK__po_optio__CA195970428D3A2E] PRIMARY KEY CLUSTERED ([SID])
    WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
    ON [PRIMARY]
    GO





