CREATE TABLE `bpm_model` (
	`model_id` BIGINT(20) NOT NULL,
	`model_full_name` VARCHAR(64) NULL DEFAULT NULL COMMENT '用.连接唯一地址：模块名+全路径名称' COLLATE 'utf8_unicode_ci',
	`model_name` VARCHAR(200) NOT NULL COMMENT '名称' COLLATE 'utf8_unicode_ci',
	`model_type` TINYINT(4) NOT NULL DEFAULT '0' COMMENT '模型类型: 1 数据模型，2 工作流模型，3  PC界面，4 手机界面',
	`model_content` MEDIUMTEXT NULL DEFAULT NULL COMMENT '内容，json格式' COLLATE 'utf8_unicode_ci',
	`model_content_sign` VARCHAR(100) NULL DEFAULT NULL COMMENT 'sha256(内容),内容长度',
	`model_status` TINYINT(4) NOT NULL DEFAULT '0' COMMENT '状态：0 启用，1 禁用',
	`model_version` INT(11) NOT NULL DEFAULT '0' COMMENT '版本',
	`model_order` INT(11) NOT NULL DEFAULT '0' COMMENT '排序',
	`model_site_id` BIGINT(20) NULL DEFAULT NULL COMMENT '站点ID',
	`model_create_time` BIGINT(20) NOT NULL DEFAULT '0' COMMENT '创建时间',
	`model_last_time` BIGINT(20) NOT NULL DEFAULT '0' COMMENT '更新时间',
	PRIMARY KEY (`model_id`) USING BTREE,
	UNIQUE INDEX `model_full_name` (`model_full_name`) USING BTREE
)
COMMENT='应用支撑平台模型定义'
COLLATE='utf8_unicode_ci'
ENGINE=InnoDB
ROW_FORMAT=DYNAMIC
;

ALTER TABLE `asp_model`
	CHANGE COLUMN `model_create_at` `model_create_time` BIGINT NOT NULL DEFAULT 0 COMMENT '创建时间' AFTER `model_update_uid`,
	CHANGE COLUMN `model_update_at` `model_last_time` BIGINT NOT NULL DEFAULT 0 COMMENT '更新时间' AFTER `model_create_time`;

ALTER TABLE `asp_model_catalog`
	CHANGE COLUMN `mc_create_at` `mc_create_time` BIGINT NOT NULL DEFAULT 0 AFTER `mc_module`,
	CHANGE COLUMN `mc_update_at` `mc_last_time` BIGINT NOT NULL DEFAULT 0 AFTER `mc_create_time`;

ALTER TABLE `asp_model_deploy`
	CHANGE COLUMN `md_create_at` `md_create_time` BIGINT NOT NULL DEFAULT 0 COMMENT '创建时间' AFTER `md_update_uid`,
	CHANGE COLUMN `md_update_at` `md_last_time` BIGINT NOT NULL DEFAULT 0 COMMENT '更新时间' AFTER `md_create_time`;

ALTER TABLE `bpm_dyn_form_log`
	CHANGE COLUMN `dfl_create_at` `dfl_create_time` BIGINT NOT NULL DEFAULT 0 AFTER `dfl_lock_rev`,
	CHANGE COLUMN `dfl_update_at` `dfl_last_time` BIGINT NOT NULL DEFAULT 0 AFTER `dfl_create_time`;

ALTER TABLE `bpm_node_log`
	CHANGE COLUMN `nl_create_at` `nl_create_time` BIGINT NOT NULL DEFAULT 0 COMMENT '创建时间' AFTER `nl_duration`;

ALTER TABLE `bpm_process`
	CHANGE COLUMN `process_create_at` `process_create_time` BIGINT NOT NULL DEFAULT 0 COMMENT '创建时间' AFTER `process_route`,
	CHANGE COLUMN `process_update_at` `process_last_time` BIGINT NOT NULL DEFAULT 0 COMMENT '更新时间' AFTER `process_create_time`;

ALTER TABLE `bpm_process_user`
	CHANGE COLUMN `pu_create_at` `pu_create_time` BIGINT NOT NULL DEFAULT 0 AFTER `pu_type`,
	CHANGE COLUMN `pu_update_at` `pu_last_time` BIGINT NOT NULL DEFAULT 0 AFTER `pu_create_time`;

ALTER TABLE `bpm_task`
	CHANGE COLUMN `task_create_at` `task_create_time` BIGINT NOT NULL DEFAULT 0 COMMENT '创建时间' AFTER `task_due_time`,
	CHANGE COLUMN `task_update_at` `task_last_time` BIGINT NOT NULL DEFAULT 0 COMMENT '更新时间' AFTER `task_create_time`;

ALTER TABLE `bpm_process_log`
	CHANGE COLUMN `pl_create_at` `pl_create_time` BIGINT NOT NULL DEFAULT 0 COMMENT '创建时间' AFTER `pl_route`;

ALTER TABLE `bpm_process_attachment_log`
	CHANGE COLUMN `pal_create_at` `pal_create_time` BIGINT NOT NULL DEFAULT 0 COMMENT '创建时间' AFTER `pal_type`;

ALTER TABLE `bpm_process_comment_log`
	CHANGE COLUMN `pcl_create_at` `pcl_create_time` BIGINT NOT NULL DEFAULT 0 COMMENT '创建时间' AFTER `pcl_content`;

ALTER TABLE `bpm_process_detail_log`
	CHANGE COLUMN `pdl_create_at` `pdl_create_time` BIGINT NOT NULL DEFAULT 0 AFTER `pdl_lock_rev`,
	CHANGE COLUMN `pdl_update_at` `pdl_last_time` BIGINT NOT NULL DEFAULT 0 AFTER `pdl_create_time`;

ALTER TABLE `bpm_task_log`
	CHANGE COLUMN `tl_create_at` `tl_create_time` BIGINT NOT NULL DEFAULT 0 COMMENT '创建时间' AFTER `tl_claim_time`;

ALTER TABLE `bpm_variable`
	CHANGE COLUMN `var_create_at` `var_create_time` BIGINT NOT NULL DEFAULT 0 AFTER `var_lock_rev`,
	CHANGE COLUMN `var_update_at` `var_update_time` BIGINT NOT NULL DEFAULT 0 AFTER `var_create_time`;

ALTER TABLE `bpm_variable_log`
	CHANGE COLUMN `vl_create_at` `vl_create_time` BIGINT NOT NULL DEFAULT 0 AFTER `vl_lock_rev`;
