drop table if exists sp_deployment;

CREATE TABLE `sp_deployment` (
  `id` varchar(32) CHARACTER SET utf8 NOT NULL COMMENT '主键',
  `created_by` varchar(32) CHARACTER SET utf8 DEFAULT NULL COMMENT '创建人',
  `created_time` datetime DEFAULT NULL COMMENT '创建时间',
  `updated_by` varchar(32) CHARACTER SET utf8 DEFAULT NULL COMMENT '更新人',
  `updated_time` datetime DEFAULT NULL COMMENT '更新时间',
  `sp_id` varchar(32) CHARACTER SET utf8 NOT NULL COMMENT '状态流程',
  `owner` varchar(64) CHARACTER SET utf8 NOT NULL COMMENT '属主',
  `tenant_id` varchar(32) CHARACTER SET utf8 NOT NULL DEFAULT 'NK' COMMENT '租户',
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_sp_dep` (`sp_id`,`owner`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='状态流程部署';