

-------------------------------------------------------------------------------
--  task info
-------------------------------------------------------------------------------
CREATE TABLE TASK_INFO(
	ID BIGINT NOT NULL,
	BUSINESS_KEY VARCHAR(100),
	CODE VARCHAR(100),
	NAME VARCHAR(200),
	DESCRIPTION VARCHAR(200),
	PRIORITY INT,
	CATALOG VARCHAR(100),
	FORM VARCHAR(100),
	TENANT_ID VARCHAR(100),

	STATUS VARCHAR(50),
	SUSPEND_STATUS VARCHAR(50),
	DELEGATE_STATUS VARCHAR(50),
	COMPLETE_STATUS VARCHAR(50),
	SKIP_STATUS VARCHAR(50),
	ESCALATE_STATUS VARCHAR(50),
	COPY_STATUS VARCHAR(50),
	COPY_TASK_ID VARCHAR(64),

	PRESENTATION_NAME VARCHAR(200),
	PRESENTATION_SUBJECT VARCHAR(200),

	CREATE_TIME DATETIME,
	ACTIVATION_TIME DATETIME,
	CLAIM_TIME DATETIME,
	COMPLETE_TIME DATETIME,
	EXPIRATION_TIME DATETIME,
	LAST_MODIFIED_TIME DATETIME,
	DURATION VARCHAR(50),

	CREATOR VARCHAR(64),
	INITIATOR VARCHAR(64),
	ASSIGNEE VARCHAR(64),
	OWNER VARCHAR(64),
	LAST_MODIFIER VARCHAR(64),
	SWIMLANE VARCHAR(100),

	PARENT_ID BIGINT,

	TASK_ID VARCHAR(200),
	EXECUTION_ID VARCHAR(200),
	PROCESS_INSTANCE_ID VARCHAR(200),
	PROCESS_DEFINITION_ID VARCHAR(200),

	CONSTRAINT PK_TASK_INFO PRIMARY KEY(ID),
	CONSTRAINT FK_TASK_INFO_PARENT FOREIGN KEY(PARENT_ID) REFERENCES TASK_INFO(ID)
);

COMMENT ON TABLE TASK_INFO IS '人工任务';
COMMENT ON COLUMN TASK_INFO.ID IS '主键';
COMMENT ON COLUMN TASK_INFO.BUSINESS_KEY IS '业务标识';
COMMENT ON COLUMN TASK_INFO.CODE IS '代码';
COMMENT ON COLUMN TASK_INFO.NAME IS '任务名称';
COMMENT ON COLUMN TASK_INFO.DESCRIPTION IS '任务描述';
COMMENT ON COLUMN TASK_INFO.PRIORITY IS '优先级';
COMMENT ON COLUMN TASK_INFO.CATALOG IS '分类';
COMMENT ON COLUMN TASK_INFO.FORM IS '表单';
COMMENT ON COLUMN TASK_INFO.TENANT_ID IS '租户';

COMMENT ON COLUMN TASK_INFO.STATUS IS '状态';
COMMENT ON COLUMN TASK_INFO.SUSPEND_STATUS IS '暂停状态';
COMMENT ON COLUMN TASK_INFO.DELEGATE_STATUS IS '代理状态';
COMMENT ON COLUMN TASK_INFO.COMPLETE_STATUS IS '完成状态';
COMMENT ON COLUMN TASK_INFO.SKIP_STATUS IS '跳过状态';
COMMENT ON COLUMN TASK_INFO.ESCALATE_STATUS IS '升级状态';
COMMENT ON COLUMN TASK_INFO.COPY_STATUS IS '抄送状态';
COMMENT ON COLUMN TASK_INFO.COPY_TASK_ID IS '抄送任务ID';

COMMENT ON COLUMN TASK_INFO.PRESENTATION_NAME IS '展示名称';
COMMENT ON COLUMN TASK_INFO.PRESENTATION_SUBJECT IS '展示标题';

COMMENT ON COLUMN TASK_INFO.CREATE_TIME IS '创建时间';
COMMENT ON COLUMN TASK_INFO.ACTIVATION_TIME IS '激活时间';
COMMENT ON COLUMN TASK_INFO.CLAIM_TIME IS '领取时间';
COMMENT ON COLUMN TASK_INFO.COMPLETE_TIME IS '完成时间';
COMMENT ON COLUMN TASK_INFO.EXPIRATION_TIME IS '过期时间';
COMMENT ON COLUMN TASK_INFO.LAST_MODIFIED_TIME IS '最后修改时间';
COMMENT ON COLUMN TASK_INFO.DURATION IS '持续时间';

COMMENT ON COLUMN TASK_INFO.CREATOR IS '创建人';
COMMENT ON COLUMN TASK_INFO.INITIATOR IS '任务发起人';
COMMENT ON COLUMN TASK_INFO.ASSIGNEE IS '负责人';
COMMENT ON COLUMN TASK_INFO.OWNER IS '委托人（被代理）';
COMMENT ON COLUMN TASK_INFO.LAST_MODIFIER IS '最后处理人';
COMMENT ON COLUMN TASK_INFO.SWIMLANE IS '泳道';

COMMENT ON COLUMN TASK_INFO.PARENT_ID IS '外键，父任务';
COMMENT ON COLUMN TASK_INFO.TASK_ID IS '关联的任务ID';
COMMENT ON COLUMN TASK_INFO.EXECUTION_ID IS '关联的分支ID';
COMMENT ON COLUMN TASK_INFO.PROCESS_INSTANCE_ID IS '关联的流程实例ID';
COMMENT ON COLUMN TASK_INFO.PROCESS_DEFINITION_ID IS '关联的流程定义ID';







