CREATE TABLE "JOBCLUSTER"
(
"ID" BIGINT IDENTITY(1, 1) NOT NULL,
"CLUSTERID" VARCHAR(64) NOT NULL,
"DESCRIPTION" VARCHAR(128),
"STATUS" INT NOT NULL,
"UPDATEDTIME" TIMESTAMP(6),
NOT CLUSTER PRIMARY KEY("ID")) STORAGE(ON "MAIN", CLUSTERBTR) ;

COMMENT ON TABLE "JOBCLUSTER" IS '系统作业集群表';
COMMENT ON COLUMN "JOBCLUSTER"."CLUSTERID" IS '作业集群Id';
COMMENT ON COLUMN "JOBCLUSTER"."DESCRIPTION" IS '描述信息';
COMMENT ON COLUMN "JOBCLUSTER"."ID" IS 'Id';
COMMENT ON COLUMN "JOBCLUSTER"."STATUS" IS '状态';
COMMENT ON COLUMN "JOBCLUSTER"."UPDATEDTIME" IS '更新时间';

CREATE TABLE "JOBDETAILS"
(
"ID" BIGINT IDENTITY(1, 1) NOT NULL,
"JOBID" VARCHAR(64) NOT NULL,
"GROUPNAME" VARCHAR(128),
"JOBTYPE" VARCHAR(128),
"ASSEMBLYNAME" VARCHAR(128),
"DESCRIPTION" VARCHAR(128),
"CONCURRENT" NUMBER NOT NULL,
"INCLUDEANNOTATIONS" NUMBER NOT NULL,
"PROPERTIES" TEXT,
"UPDATEDTIME" TIMESTAMP(6),
"CREATETYPE" INT NOT NULL,
"SCRIPTCODE" TEXT,
"TENANTID" VARCHAR(50),
NOT CLUSTER PRIMARY KEY("ID")) STORAGE(ON "MAIN", CLUSTERBTR) ;

COMMENT ON TABLE "JOBDETAILS" IS '作业信息表';
COMMENT ON COLUMN "JOBDETAILS"."ASSEMBLYNAME" IS '程序集';
COMMENT ON COLUMN "JOBDETAILS"."CONCURRENT" IS '是否并行执行';
COMMENT ON COLUMN "JOBDETAILS"."CREATETYPE" IS '作业创建类型';
COMMENT ON COLUMN "JOBDETAILS"."DESCRIPTION" IS '描述信息';
COMMENT ON COLUMN "JOBDETAILS"."GROUPNAME" IS '组名称';
COMMENT ON COLUMN "JOBDETAILS"."ID" IS 'Id';
COMMENT ON COLUMN "JOBDETAILS"."INCLUDEANNOTATIONS" IS '是否扫描特性触发器';
COMMENT ON COLUMN "JOBDETAILS"."JOBID" IS '作业Id';
COMMENT ON COLUMN "JOBDETAILS"."JOBTYPE" IS '作业类型';
COMMENT ON COLUMN "JOBDETAILS"."PROPERTIES" IS '额外数据';
COMMENT ON COLUMN "JOBDETAILS"."SCRIPTCODE" IS '脚本代码';
COMMENT ON COLUMN "JOBDETAILS"."TENANTID" IS '租户ID';
COMMENT ON COLUMN "JOBDETAILS"."UPDATEDTIME" IS '更新时间';

CREATE TABLE "JOBTRIGGERS"
(
"ID" BIGINT IDENTITY(1, 1) NOT NULL,
"TRIGGERID" VARCHAR(64) NOT NULL,
"JOBID" VARCHAR(64) NOT NULL,
"TRIGGERTYPE" VARCHAR(128),
"ASSEMBLYNAME" VARCHAR(128),
"ARGS" VARCHAR(128),
"DESCRIPTION" VARCHAR(128),
"STATUS" INT NOT NULL,
"STARTTIME" TIMESTAMP(6),
"ENDTIME" TIMESTAMP(6),
"LASTRUNTIME" TIMESTAMP(6),
"NEXTRUNTIME" TIMESTAMP(6),
"NUMBEROFRUNS" BIGINT NOT NULL,
"MAXNUMBEROFRUNS" BIGINT NOT NULL,
"NUMBEROFERRORS" BIGINT NOT NULL,
"MAXNUMBEROFERRORS" BIGINT NOT NULL,
"NUMRETRIES" INT NOT NULL,
"RETRYTIMEOUT" INT NOT NULL,
"STARTNOW" NUMBER NOT NULL,
"RUNONSTART" NUMBER NOT NULL,
"RESETONLYONCE" NUMBER NOT NULL,
"UPDATEDTIME" TIMESTAMP(6),
NOT CLUSTER PRIMARY KEY("ID")) STORAGE(ON "MAIN", CLUSTERBTR) ;

COMMENT ON TABLE "JOBTRIGGERS" IS '作业触发器表';
COMMENT ON COLUMN "JOBTRIGGERS"."ARGS" IS '参数';
COMMENT ON COLUMN "JOBTRIGGERS"."ASSEMBLYNAME" IS '程序集';
COMMENT ON COLUMN "JOBTRIGGERS"."DESCRIPTION" IS '描述信息';
COMMENT ON COLUMN "JOBTRIGGERS"."ENDTIME" IS '结束时间';
COMMENT ON COLUMN "JOBTRIGGERS"."ID" IS 'Id';
COMMENT ON COLUMN "JOBTRIGGERS"."JOBID" IS '作业Id';
COMMENT ON COLUMN "JOBTRIGGERS"."LASTRUNTIME" IS '最近运行时间';
COMMENT ON COLUMN "JOBTRIGGERS"."MAXNUMBEROFERRORS" IS '最大出错次数';
COMMENT ON COLUMN "JOBTRIGGERS"."MAXNUMBEROFRUNS" IS '最大触发次数';
COMMENT ON COLUMN "JOBTRIGGERS"."NEXTRUNTIME" IS '下一次运行时间';
COMMENT ON COLUMN "JOBTRIGGERS"."NUMBEROFERRORS" IS '出错次数';
COMMENT ON COLUMN "JOBTRIGGERS"."NUMBEROFRUNS" IS '触发次数';
COMMENT ON COLUMN "JOBTRIGGERS"."NUMRETRIES" IS '重试次数';
COMMENT ON COLUMN "JOBTRIGGERS"."RESETONLYONCE" IS '是否在启动时重置最大触发次数等于一次的作业';
COMMENT ON COLUMN "JOBTRIGGERS"."RETRYTIMEOUT" IS '重试间隔时间(ms)';
COMMENT ON COLUMN "JOBTRIGGERS"."RUNONSTART" IS '是否启动时执行一次';
COMMENT ON COLUMN "JOBTRIGGERS"."STARTNOW" IS '是否立即启动';
COMMENT ON COLUMN "JOBTRIGGERS"."STARTTIME" IS '起始时间';
COMMENT ON COLUMN "JOBTRIGGERS"."STATUS" IS '状态';
COMMENT ON COLUMN "JOBTRIGGERS"."TRIGGERID" IS '触发器Id';
COMMENT ON COLUMN "JOBTRIGGERS"."TRIGGERTYPE" IS '触发器类型';
COMMENT ON COLUMN "JOBTRIGGERS"."UPDATEDTIME" IS '更新时间';

