
-- ----------------------------
-- Sequence structure for jobcluster_id_seq
-- ----------------------------
DROP SEQUENCE IF EXISTS "jobcluster_id_seq";
CREATE SEQUENCE "jobcluster_id_seq" 
INCREMENT 1
MINVALUE  1
MAXVALUE 9223372036854775807
START 1
CACHE 1;

-- ----------------------------
-- Sequence structure for jobdetails_id_seq
-- ----------------------------
DROP SEQUENCE IF EXISTS "jobdetails_id_seq";
CREATE SEQUENCE "jobdetails_id_seq" 
INCREMENT 1
MINVALUE  1
MAXVALUE 9223372036854775807
START 1
CACHE 1;

-- ----------------------------
-- Sequence structure for jobtriggers_id_seq
-- ----------------------------
DROP SEQUENCE IF EXISTS "jobtriggers_id_seq";
CREATE SEQUENCE "jobtriggers_id_seq" 
INCREMENT 1
MINVALUE  1
MAXVALUE 9223372036854775807
START 1
CACHE 1;

-- ----------------------------
-- Table structure for jobcluster
-- ----------------------------
DROP TABLE IF EXISTS "jobcluster";
CREATE TABLE "jobcluster" (
  "id" int8 NOT NULL DEFAULT nextval('jobcluster_id_seq'::regclass),
  "clusterid" varchar(64) COLLATE "pg_catalog"."default" NOT NULL,
  "description" varchar(128) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "status" int4 NOT NULL,
  "updatedtime" timestamp(6)
)
;
COMMENT ON COLUMN "jobcluster"."id" IS 'Id';
COMMENT ON COLUMN "jobcluster"."clusterid" IS '作业集群Id';
COMMENT ON COLUMN "jobcluster"."description" IS '描述信息';
COMMENT ON COLUMN "jobcluster"."status" IS '状态';
COMMENT ON COLUMN "jobcluster"."updatedtime" IS '更新时间';
COMMENT ON TABLE "jobcluster" IS '系统作业集群表';

-- ----------------------------
-- Table structure for jobdetails
-- ----------------------------
DROP TABLE IF EXISTS "jobdetails";
CREATE TABLE "jobdetails" (
  "id" int8 NOT NULL DEFAULT nextval('jobdetails_id_seq'::regclass),
  "jobid" varchar(64) COLLATE "pg_catalog"."default" NOT NULL,
  "groupname" varchar(128) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "jobtype" varchar(128) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "assemblyname" varchar(128) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "description" varchar(128) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "concurrent" bool NOT NULL,
  "includeannotations" bool NOT NULL,
  "properties" text COLLATE "pg_catalog"."default",
  "updatedtime" timestamp(6),
  "createtype" int4 NOT NULL,
  "scriptcode" text COLLATE "pg_catalog"."default",
  "tenantid" varchar(50) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying
)
;
COMMENT ON COLUMN "jobdetails"."id" IS 'Id';
COMMENT ON COLUMN "jobdetails"."jobid" IS '作业Id';
COMMENT ON COLUMN "jobdetails"."groupname" IS '组名称';
COMMENT ON COLUMN "jobdetails"."jobtype" IS '作业类型';
COMMENT ON COLUMN "jobdetails"."assemblyname" IS '程序集';
COMMENT ON COLUMN "jobdetails"."description" IS '描述信息';
COMMENT ON COLUMN "jobdetails"."concurrent" IS '是否并行执行';
COMMENT ON COLUMN "jobdetails"."includeannotations" IS '是否扫描特性触发器';
COMMENT ON COLUMN "jobdetails"."properties" IS '额外数据';
COMMENT ON COLUMN "jobdetails"."updatedtime" IS '更新时间';
COMMENT ON COLUMN "jobdetails"."createtype" IS '作业创建类型';
COMMENT ON COLUMN "jobdetails"."scriptcode" IS '脚本代码';
COMMENT ON COLUMN "jobdetails"."tenantid" IS '租户ID';
COMMENT ON TABLE "jobdetails" IS '作业信息表';

-- ----------------------------
-- Table structure for jobtriggers
-- ----------------------------
DROP TABLE IF EXISTS "jobtriggers";
CREATE TABLE "jobtriggers" (
  "id" int8 NOT NULL DEFAULT nextval('jobtriggers_id_seq'::regclass),
  "triggerid" varchar(64) COLLATE "pg_catalog"."default" NOT NULL,
  "jobid" varchar(64) COLLATE "pg_catalog"."default" NOT NULL,
  "triggertype" varchar(128) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "assemblyname" varchar(128) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "args" varchar(128) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "description" varchar(128) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "status" int4 NOT NULL,
  "starttime" timestamp(6),
  "endtime" timestamp(6),
  "lastruntime" timestamp(6),
  "nextruntime" timestamp(6),
  "numberofruns" int8 NOT NULL,
  "maxnumberofruns" int8 NOT NULL,
  "numberoferrors" int8 NOT NULL,
  "maxnumberoferrors" int8 NOT NULL,
  "numretries" int4 NOT NULL,
  "retrytimeout" int4 NOT NULL,
  "startnow" bool NOT NULL,
  "runonstart" bool NOT NULL,
  "resetonlyonce" bool NOT NULL,
  "updatedtime" timestamp(6)
)
;
COMMENT ON COLUMN "jobtriggers"."id" IS 'Id';
COMMENT ON COLUMN "jobtriggers"."triggerid" IS '触发器Id';
COMMENT ON COLUMN "jobtriggers"."jobid" IS '作业Id';
COMMENT ON COLUMN "jobtriggers"."triggertype" IS '触发器类型';
COMMENT ON COLUMN "jobtriggers"."assemblyname" IS '程序集';
COMMENT ON COLUMN "jobtriggers"."args" IS '参数';
COMMENT ON COLUMN "jobtriggers"."description" IS '描述信息';
COMMENT ON COLUMN "jobtriggers"."status" IS '状态';
COMMENT ON COLUMN "jobtriggers"."starttime" IS '起始时间';
COMMENT ON COLUMN "jobtriggers"."endtime" IS '结束时间';
COMMENT ON COLUMN "jobtriggers"."lastruntime" IS '最近运行时间';
COMMENT ON COLUMN "jobtriggers"."nextruntime" IS '下一次运行时间';
COMMENT ON COLUMN "jobtriggers"."numberofruns" IS '触发次数';
COMMENT ON COLUMN "jobtriggers"."maxnumberofruns" IS '最大触发次数';
COMMENT ON COLUMN "jobtriggers"."numberoferrors" IS '出错次数';
COMMENT ON COLUMN "jobtriggers"."maxnumberoferrors" IS '最大出错次数';
COMMENT ON COLUMN "jobtriggers"."numretries" IS '重试次数';
COMMENT ON COLUMN "jobtriggers"."retrytimeout" IS '重试间隔时间(ms)';
COMMENT ON COLUMN "jobtriggers"."startnow" IS '是否立即启动';
COMMENT ON COLUMN "jobtriggers"."runonstart" IS '是否启动时执行一次';
COMMENT ON COLUMN "jobtriggers"."resetonlyonce" IS '是否在启动时重置最大触发次数等于一次的作业';
COMMENT ON COLUMN "jobtriggers"."updatedtime" IS '更新时间';
COMMENT ON TABLE "jobtriggers" IS '作业触发器表';
