@ -33,22 +33,23 @@ Use ApolloConfigDB;
DROP TABLE IF EXISTS ` App ` ;
CREATE TABLE ` App ` (
` Id ` int ( 10 ) unsigned NOT NULL AUTO_INCREMENT COMMENT ' 主键 ' ,
` AppId ` varchar ( 500 ) NOT NULL DEFAULT ' default ' COMMENT ' AppID ' ,
` Name ` varchar ( 500 ) NOT NULL DEFAULT ' default ' COMMENT ' 应用名 ' ,
` OrgId ` varchar ( 32 ) NOT NULL DEFAULT ' default ' COMMENT ' 部门Id ' ,
` OrgName ` varchar ( 64 ) NOT NULL DEFAULT ' default ' COMMENT ' 部门名字 ' ,
` OwnerName ` varchar ( 500 ) NOT NULL DEFAULT ' default ' COMMENT ' ownerName ' ,
` OwnerEmail ` varchar ( 500 ) NOT NULL DEFAULT ' default ' COMMENT ' ownerEmail ' ,
` IsDeleted ` bit ( 1 ) NOT NULL DEFAULT b ' 0 ' COMMENT ' 1: deleted, 0: normal ' ,
` DataChange_CreatedBy ` varchar ( 64 ) NOT NULL DEFAULT ' default ' COMMENT ' 创建人邮箱前缀 ' ,
` DataChange_CreatedTime ` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT ' 创建时间 ' ,
` DataChange_LastModifiedBy ` varchar ( 64 ) DEFAULT ' ' COMMENT ' 最后修改人邮箱前缀 ' ,
` DataChange_LastTime ` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT ' 最后修改时间 ' ,
PRIMARY KEY ( ` Id ` ) ,
KEY ` AppId ` ( ` AppId ` ( 191 ) ) ,
KEY ` DataChange_LastTime ` ( ` DataChange_LastTime ` ) ,
KEY ` IX_Name ` ( ` Name ` ( 191 ) )
` Id ` int ( 10 ) unsigned NOT NULL AUTO_INCREMENT COMMENT ' 主键 ' ,
` AppId ` varchar ( 500 ) NOT NULL DEFAULT ' default ' COMMENT ' AppID ' ,
` Name ` varchar ( 500 ) NOT NULL DEFAULT ' default ' COMMENT ' 应用名 ' ,
` OrgId ` varchar ( 32 ) NOT NULL DEFAULT ' default ' COMMENT ' 部门Id ' ,
` OrgName ` varchar ( 64 ) NOT NULL DEFAULT ' default ' COMMENT ' 部门名字 ' ,
` OwnerName ` varchar ( 500 ) NOT NULL DEFAULT ' default ' COMMENT ' ownerName ' ,
` OwnerEmail ` varchar ( 500 ) NOT NULL DEFAULT ' default ' COMMENT ' ownerEmail ' ,
` IsDeleted ` bit ( 1 ) NOT NULL DEFAULT b ' 0 ' COMMENT ' 1: deleted, 0: normal ' ,
` DeletedAt ` BIGINT ( 20 ) NOT NULL DEFAULT ' 0 ' COMMENT ' Delete timestamp based on milliseconds ' ,
` DataChange_CreatedBy ` varchar ( 64 ) NOT NULL DEFAULT ' default ' COMMENT ' 创建人邮箱前缀 ' ,
` DataChange_CreatedTime ` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT ' 创建时间 ' ,
` DataChange_LastModifiedBy ` varchar ( 64 ) DEFAULT ' ' COMMENT ' 最后修改人邮箱前缀 ' ,
` DataChange_LastTime ` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT ' 最后修改时间 ' ,
PRIMARY KEY ( ` Id ` ) ,
UNIQUE KEY ` UK_AppId_DeletedAt ` ( ` AppId ` , ` DeletedAt ` ) ,
KEY ` DataChange_LastTime ` ( ` DataChange_LastTime ` ) ,
KEY ` IX_Name ` ( ` Name ` ( 191 ) )
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COMMENT = ' 应用表 ' ;
@ -59,21 +60,22 @@ CREATE TABLE `App` (
DROP TABLE IF EXISTS ` AppNamespace ` ;
CREATE TABLE ` AppNamespace ` (
` Id ` int ( 10 ) unsigned NOT NULL AUTO_INCREMENT COMMENT ' 自增主键 ' ,
` Name ` varchar ( 32 ) NOT NULL DEFAULT ' ' COMMENT ' namespace名字, 注意, 需要全局唯一 ' ,
` AppId ` varchar ( 64 ) NOT NULL DEFAULT ' ' COMMENT ' app id ' ,
` Format ` varchar ( 32 ) NOT NULL DEFAULT ' properties ' COMMENT ' namespace的format类型 ' ,
` IsPublic ` bit ( 1 ) NOT NULL DEFAULT b ' 0 ' COMMENT ' namespace是否为公共 ' ,
` Comment ` varchar ( 64 ) NOT NULL DEFAULT ' ' COMMENT ' 注释 ' ,
` IsDeleted ` bit ( 1 ) NOT NULL DEFAULT b ' 0 ' COMMENT ' 1: deleted, 0: normal ' ,
` DataChange_CreatedBy ` varchar ( 64 ) NOT NULL DEFAULT ' default ' COMMENT ' 创建人邮箱前缀 ' ,
` DataChange_CreatedTime ` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT ' 创建时间 ' ,
` DataChange_LastModifiedBy ` varchar ( 64 ) DEFAULT ' ' COMMENT ' 最后修改人邮箱前缀 ' ,
` DataChange_LastTime ` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT ' 最后修改时间 ' ,
PRIMARY KEY ( ` Id ` ) ,
KEY ` IX_AppId ` ( ` AppId ` ) ,
KEY ` Name_AppId ` ( ` Name ` , ` AppId ` ) ,
KEY ` DataChange_LastTime ` ( ` DataChange_LastTime ` )
` Id ` int ( 10 ) unsigned NOT NULL AUTO_INCREMENT COMMENT ' 自增主键 ' ,
` Name ` varchar ( 32 ) NOT NULL DEFAULT ' ' COMMENT ' namespace名字, 注意, 需要全局唯一 ' ,
` AppId ` varchar ( 64 ) NOT NULL DEFAULT ' ' COMMENT ' app id ' ,
` Format ` varchar ( 32 ) NOT NULL DEFAULT ' properties ' COMMENT ' namespace的format类型 ' ,
` IsPublic ` bit ( 1 ) NOT NULL DEFAULT b ' 0 ' COMMENT ' namespace是否为公共 ' ,
` Comment ` varchar ( 64 ) NOT NULL DEFAULT ' ' COMMENT ' 注释 ' ,
` IsDeleted ` bit ( 1 ) NOT NULL DEFAULT b ' 0 ' COMMENT ' 1: deleted, 0: normal ' ,
` DeletedAt ` BIGINT ( 20 ) NOT NULL DEFAULT ' 0 ' COMMENT ' Delete timestamp based on milliseconds ' ,
` DataChange_CreatedBy ` varchar ( 64 ) NOT NULL DEFAULT ' default ' COMMENT ' 创建人邮箱前缀 ' ,
` DataChange_CreatedTime ` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT ' 创建时间 ' ,
` DataChange_LastModifiedBy ` varchar ( 64 ) DEFAULT ' ' COMMENT ' 最后修改人邮箱前缀 ' ,
` DataChange_LastTime ` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT ' 最后修改时间 ' ,
PRIMARY KEY ( ` Id ` ) ,
UNIQUE KEY ` UK_AppId_Name_DeletedAt ` ( ` AppId ` , ` Name ` , ` DeletedAt ` ) ,
KEY ` Name_AppId ` ( ` Name ` , ` AppId ` ) ,
KEY ` DataChange_LastTime ` ( ` DataChange_LastTime ` )
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COMMENT = ' 应用namespace定义 ' ;
@ -84,18 +86,19 @@ CREATE TABLE `AppNamespace` (
DROP TABLE IF EXISTS ` Audit ` ;
CREATE TABLE ` Audit ` (
` Id ` int ( 10 ) unsigned NOT NULL AUTO_INCREMENT COMMENT ' 主键 ' ,
` EntityName ` varchar ( 50 ) NOT NULL DEFAULT ' default ' COMMENT ' 表名 ' ,
` EntityId ` int ( 10 ) unsigned DEFAULT NULL COMMENT ' 记录ID ' ,
` OpName ` varchar ( 50 ) NOT NULL DEFAULT ' default ' COMMENT ' 操作类型 ' ,
` Comment ` varchar ( 500 ) DEFAULT NULL COMMENT ' 备注 ' ,
` IsDeleted ` bit ( 1 ) NOT NULL DEFAULT b ' 0 ' COMMENT ' 1: deleted, 0: normal ' ,
` DataChange_CreatedBy ` varchar ( 64 ) NOT NULL DEFAULT ' default ' COMMENT ' 创建人邮箱前缀 ' ,
` DataChange_CreatedTime ` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT ' 创建时间 ' ,
` DataChange_LastModifiedBy ` varchar ( 64 ) DEFAULT ' ' COMMENT ' 最后修改人邮箱前缀 ' ,
` DataChange_LastTime ` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT ' 最后修改时间 ' ,
PRIMARY KEY ( ` Id ` ) ,
KEY ` DataChange_LastTime ` ( ` DataChange_LastTime ` )
` Id ` int ( 10 ) unsigned NOT NULL AUTO_INCREMENT COMMENT ' 主键 ' ,
` EntityName ` varchar ( 50 ) NOT NULL DEFAULT ' default ' COMMENT ' 表名 ' ,
` EntityId ` int ( 10 ) unsigned DEFAULT NULL COMMENT ' 记录ID ' ,
` OpName ` varchar ( 50 ) NOT NULL DEFAULT ' default ' COMMENT ' 操作类型 ' ,
` Comment ` varchar ( 500 ) DEFAULT NULL COMMENT ' 备注 ' ,
` IsDeleted ` bit ( 1 ) NOT NULL DEFAULT b ' 0 ' COMMENT ' 1: deleted, 0: normal ' ,
` DeletedAt ` BIGINT ( 20 ) NOT NULL DEFAULT ' 0 ' COMMENT ' Delete timestamp based on milliseconds ' ,
` DataChange_CreatedBy ` varchar ( 64 ) NOT NULL DEFAULT ' default ' COMMENT ' 创建人邮箱前缀 ' ,
` DataChange_CreatedTime ` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT ' 创建时间 ' ,
` DataChange_LastModifiedBy ` varchar ( 64 ) DEFAULT ' ' COMMENT ' 最后修改人邮箱前缀 ' ,
` DataChange_LastTime ` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT ' 最后修改时间 ' ,
PRIMARY KEY ( ` Id ` ) ,
KEY ` DataChange_LastTime ` ( ` DataChange_LastTime ` )
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COMMENT = ' 日志审计表 ' ;
@ -106,19 +109,20 @@ CREATE TABLE `Audit` (
DROP TABLE IF EXISTS ` Cluster ` ;
CREATE TABLE ` Cluster ` (
` Id ` int ( 10 ) unsigned NOT NULL AUTO_INCREMENT COMMENT ' 自增主键 ' ,
` Name ` varchar ( 32 ) NOT NULL DEFAULT ' ' COMMENT ' 集群名字 ' ,
` AppId ` varchar ( 64 ) NOT NULL DEFAULT ' ' COMMENT ' App id ' ,
` ParentClusterId ` int ( 10 ) unsigned NOT NULL DEFAULT ' 0 ' COMMENT ' 父cluster ' ,
` IsDeleted ` bit ( 1 ) NOT NULL DEFAULT b ' 0 ' COMMENT ' 1: deleted, 0: normal ' ,
` DataChange_CreatedBy ` varchar ( 64 ) NOT NULL DEFAULT ' default ' COMMENT ' 创建人邮箱前缀 ' ,
` DataChange_CreatedTime ` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT ' 创建时间 ' ,
` DataChange_LastModifiedBy ` varchar ( 64 ) DEFAULT ' ' COMMENT ' 最后修改人邮箱前缀 ' ,
` DataChange_LastTime ` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT ' 最后修改时间 ' ,
PRIMARY KEY ( ` Id ` ) ,
KEY ` IX_AppId_Name ` ( ` AppId ` , ` Name ` ) ,
KEY ` IX_ParentClusterId ` ( ` ParentClusterId ` ) ,
KEY ` DataChange_LastTime ` ( ` DataChange_LastTime ` )
` Id ` int ( 10 ) unsigned NOT NULL AUTO_INCREMENT COMMENT ' 自增主键 ' ,
` Name ` varchar ( 32 ) NOT NULL DEFAULT ' ' COMMENT ' 集群名字 ' ,
` AppId ` varchar ( 64 ) NOT NULL DEFAULT ' ' COMMENT ' App id ' ,
` ParentClusterId ` int ( 10 ) unsigned NOT NULL DEFAULT ' 0 ' COMMENT ' 父cluster ' ,
` IsDeleted ` bit ( 1 ) NOT NULL DEFAULT b ' 0 ' COMMENT ' 1: deleted, 0: normal ' ,
` DeletedAt ` BIGINT ( 20 ) NOT NULL DEFAULT ' 0 ' COMMENT ' Delete timestamp based on milliseconds ' ,
` DataChange_CreatedBy ` varchar ( 64 ) NOT NULL DEFAULT ' default ' COMMENT ' 创建人邮箱前缀 ' ,
` DataChange_CreatedTime ` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT ' 创建时间 ' ,
` DataChange_LastModifiedBy ` varchar ( 64 ) DEFAULT ' ' COMMENT ' 最后修改人邮箱前缀 ' ,
` DataChange_LastTime ` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT ' 最后修改时间 ' ,
PRIMARY KEY ( ` Id ` ) ,
UNIQUE KEY ` UK_AppId_Name_DeletedAt ` ( ` AppId ` , ` Name ` , ` DeletedAt ` ) ,
KEY ` IX_ParentClusterId ` ( ` ParentClusterId ` ) ,
KEY ` DataChange_LastTime ` ( ` DataChange_LastTime ` )
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COMMENT = ' 集群 ' ;
@ -129,22 +133,23 @@ CREATE TABLE `Cluster` (
DROP TABLE IF EXISTS ` Commit ` ;
CREATE TABLE ` Commit ` (
` Id ` int ( 10 ) unsigned NOT NULL AUTO_INCREMENT COMMENT ' 主键 ' ,
` ChangeSets ` longtext NOT NULL COMMENT ' 修改变更集 ' ,
` AppId ` varchar ( 500 ) NOT NULL DEFAULT ' default ' COMMENT ' AppID ' ,
` ClusterName ` varchar ( 500 ) NOT NULL DEFAULT ' default ' COMMENT ' ClusterName ' ,
` NamespaceName ` varchar ( 500 ) NOT NULL DEFAULT ' default ' COMMENT ' namespaceName ' ,
` Comment ` varchar ( 500 ) DEFAULT NULL COMMENT ' 备注 ' ,
` IsDeleted ` bit ( 1 ) NOT NULL DEFAULT b ' 0 ' COMMENT ' 1: deleted, 0: normal ' ,
` DataChange_CreatedBy ` varchar ( 64 ) NOT NULL DEFAULT ' default ' COMMENT ' 创建人邮箱前缀 ' ,
` DataChange_CreatedTime ` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT ' 创建时间 ' ,
` DataChange_LastModifiedBy ` varchar ( 64 ) DEFAULT ' ' COMMENT ' 最后修改人邮箱前缀 ' ,
` DataChange_LastTime ` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT ' 最后修改时间 ' ,
PRIMARY KEY ( ` Id ` ) ,
KEY ` DataChange_LastTime ` ( ` DataChange_LastTime ` ) ,
KEY ` AppId ` ( ` AppId ` ( 191 ) ) ,
KEY ` ClusterName ` ( ` ClusterName ` ( 191 ) ) ,
KEY ` NamespaceName ` ( ` NamespaceName ` ( 191 ) )
` Id ` int ( 10 ) unsigned NOT NULL AUTO_INCREMENT COMMENT ' 主键 ' ,
` ChangeSets ` longtext NOT NULL COMMENT ' 修改变更集 ' ,
` AppId ` varchar ( 500 ) NOT NULL DEFAULT ' default ' COMMENT ' AppID ' ,
` ClusterName ` varchar ( 500 ) NOT NULL DEFAULT ' default ' COMMENT ' ClusterName ' ,
` NamespaceName ` varchar ( 500 ) NOT NULL DEFAULT ' default ' COMMENT ' namespaceName ' ,
` Comment ` varchar ( 500 ) DEFAULT NULL COMMENT ' 备注 ' ,
` IsDeleted ` bit ( 1 ) NOT NULL DEFAULT b ' 0 ' COMMENT ' 1: deleted, 0: normal ' ,
` DeletedAt ` BIGINT ( 20 ) NOT NULL DEFAULT ' 0 ' COMMENT ' Delete timestamp based on milliseconds ' ,
` DataChange_CreatedBy ` varchar ( 64 ) NOT NULL DEFAULT ' default ' COMMENT ' 创建人邮箱前缀 ' ,
` DataChange_CreatedTime ` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT ' 创建时间 ' ,
` DataChange_LastModifiedBy ` varchar ( 64 ) DEFAULT ' ' COMMENT ' 最后修改人邮箱前缀 ' ,
` DataChange_LastTime ` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT ' 最后修改时间 ' ,
PRIMARY KEY ( ` Id ` ) ,
KEY ` DataChange_LastTime ` ( ` DataChange_LastTime ` ) ,
KEY ` AppId ` ( ` AppId ` ( 191 ) ) ,
KEY ` ClusterName ` ( ` ClusterName ` ( 191 ) ) ,
KEY ` NamespaceName ` ( ` NamespaceName ` ( 191 ) )
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COMMENT = ' commit 历史表 ' ;
# Dump of table grayreleaserule
@ -153,22 +158,23 @@ CREATE TABLE `Commit` (
DROP TABLE IF EXISTS ` GrayReleaseRule ` ;
CREATE TABLE ` GrayReleaseRule ` (
` Id ` int ( 11 ) unsigned NOT NULL AUTO_INCREMENT COMMENT ' 主键 ' ,
` AppId ` varchar ( 64 ) NOT NULL DEFAULT ' default ' COMMENT ' AppID ' ,
` ClusterName ` varchar ( 32 ) NOT NULL DEFAULT ' default ' COMMENT ' Cluster Name ' ,
` NamespaceName ` varchar ( 32 ) NOT NULL DEFAULT ' default ' COMMENT ' Namespace Name ' ,
` BranchName ` varchar ( 32 ) NOT NULL DEFAULT ' default ' COMMENT ' branch name ' ,
` Rules ` varchar ( 16000 ) DEFAULT ' [] ' COMMENT ' 灰度规则 ' ,
` ReleaseId ` int ( 11 ) unsigned NOT NULL DEFAULT ' 0 ' COMMENT ' 灰度对应的release ' ,
` BranchStatus ` tinyint ( 2 ) DEFAULT ' 1 ' COMMENT ' 灰度分支状态: 0:删除分支,1:正在使用的规则 2: 全量发布 ' ,
` IsDeleted ` bit ( 1 ) NOT NULL DEFAULT b ' 0 ' COMMENT ' 1: deleted, 0: normal ' ,
` DataChange_CreatedBy ` varchar ( 64 ) NOT NULL DEFAULT ' default ' COMMENT ' 创建人邮箱前缀 ' ,
` DataChange_CreatedTime ` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT ' 创建时间 ' ,
` DataChange_LastModifiedBy ` varchar ( 64 ) DEFAULT ' ' COMMENT ' 最后修改人邮箱前缀 ' ,
` DataChange_LastTime ` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT ' 最后修改时间 ' ,
PRIMARY KEY ( ` Id ` ) ,
KEY ` DataChange_LastTime ` ( ` DataChange_LastTime ` ) ,
KEY ` IX_Namespace ` ( ` AppId ` , ` ClusterName ` , ` NamespaceName ` )
` Id ` int ( 11 ) unsigned NOT NULL AUTO_INCREMENT COMMENT ' 主键 ' ,
` AppId ` varchar ( 64 ) NOT NULL DEFAULT ' default ' COMMENT ' AppID ' ,
` ClusterName ` varchar ( 32 ) NOT NULL DEFAULT ' default ' COMMENT ' Cluster Name ' ,
` NamespaceName ` varchar ( 32 ) NOT NULL DEFAULT ' default ' COMMENT ' Namespace Name ' ,
` BranchName ` varchar ( 32 ) NOT NULL DEFAULT ' default ' COMMENT ' branch name ' ,
` Rules ` varchar ( 16000 ) DEFAULT ' [] ' COMMENT ' 灰度规则 ' ,
` ReleaseId ` int ( 11 ) unsigned NOT NULL DEFAULT ' 0 ' COMMENT ' 灰度对应的release ' ,
` BranchStatus ` tinyint ( 2 ) DEFAULT ' 1 ' COMMENT ' 灰度分支状态: 0:删除分支,1:正在使用的规则 2: 全量发布 ' ,
` IsDeleted ` bit ( 1 ) NOT NULL DEFAULT b ' 0 ' COMMENT ' 1: deleted, 0: normal ' ,
` DeletedAt ` BIGINT ( 20 ) NOT NULL DEFAULT ' 0 ' COMMENT ' Delete timestamp based on milliseconds ' ,
` DataChange_CreatedBy ` varchar ( 64 ) NOT NULL DEFAULT ' default ' COMMENT ' 创建人邮箱前缀 ' ,
` DataChange_CreatedTime ` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT ' 创建时间 ' ,
` DataChange_LastModifiedBy ` varchar ( 64 ) DEFAULT ' ' COMMENT ' 最后修改人邮箱前缀 ' ,
` DataChange_LastTime ` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT ' 最后修改时间 ' ,
PRIMARY KEY ( ` Id ` ) ,
KEY ` DataChange_LastTime ` ( ` DataChange_LastTime ` ) ,
KEY ` IX_Namespace ` ( ` AppId ` , ` ClusterName ` , ` NamespaceName ` )
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COMMENT = ' 灰度规则表 ' ;
@ -178,17 +184,17 @@ CREATE TABLE `GrayReleaseRule` (
DROP TABLE IF EXISTS ` Instance ` ;
CREATE TABLE ` Instance ` (
` Id ` int ( 11 ) unsigned NOT NULL AUTO_INCREMENT COMMENT ' 自增Id ' ,
` AppId ` varchar ( 64 ) NOT NULL DEFAULT ' default ' COMMENT ' AppID ' ,
` ClusterName ` varchar ( 32 ) NOT NULL DEFAULT ' default ' COMMENT ' ClusterName ' ,
` DataCenter ` varchar ( 64 ) NOT NULL DEFAULT ' default ' COMMENT ' Data Center Name ' ,
` Ip ` varchar ( 32 ) NOT NULL DEFAULT ' ' COMMENT ' instance ip ' ,
` DataChange_CreatedTime ` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT ' 创建时间 ' ,
` DataChange_LastTime ` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT ' 最后修改时间 ' ,
PRIMARY KEY ( ` Id ` ) ,
UNIQUE KEY ` IX_UNIQUE_KEY ` ( ` AppId ` , ` ClusterName ` , ` Ip ` , ` DataCenter ` ) ,
KEY ` IX_IP ` ( ` Ip ` ) ,
KEY ` IX_DataChange_LastTime ` ( ` DataChange_LastTime ` )
` Id ` int ( 11 ) unsigned NOT NULL AUTO_INCREMENT COMMENT ' 自增Id ' ,
` AppId ` varchar ( 64 ) NOT NULL DEFAULT ' default ' COMMENT ' AppID ' ,
` ClusterName ` varchar ( 32 ) NOT NULL DEFAULT ' default ' COMMENT ' ClusterName ' ,
` DataCenter ` varchar ( 64 ) NOT NULL DEFAULT ' default ' COMMENT ' Data Center Name ' ,
` Ip ` varchar ( 32 ) NOT NULL DEFAULT ' ' COMMENT ' instance ip ' ,
` DataChange_CreatedTime ` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT ' 创建时间 ' ,
` DataChange_LastTime ` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT ' 最后修改时间 ' ,
PRIMARY KEY ( ` Id ` ) ,
UNIQUE KEY ` IX_UNIQUE_KEY ` ( ` AppId ` , ` ClusterName ` , ` Ip ` , ` DataCenter ` ) ,
KEY ` IX_IP ` ( ` Ip ` ) ,
KEY ` IX_DataChange_LastTime ` ( ` DataChange_LastTime ` )
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COMMENT = ' 使用配置的应用实例 ' ;
@ -199,20 +205,20 @@ CREATE TABLE `Instance` (
DROP TABLE IF EXISTS ` InstanceConfig ` ;
CREATE TABLE ` InstanceConfig ` (
` Id ` int ( 11 ) unsigned NOT NULL AUTO_INCREMENT COMMENT ' 自增Id ' ,
` InstanceId ` int ( 11 ) unsigned DEFAULT NULL COMMENT ' Instance Id ' ,
` ConfigAppId ` varchar ( 64 ) NOT NULL DEFAULT ' default ' COMMENT ' Config App Id ' ,
` ConfigClusterName ` varchar ( 32 ) NOT NULL DEFAULT ' default ' COMMENT ' Config Cluster Name ' ,
` ConfigNamespaceName ` varchar ( 32 ) NOT NULL DEFAULT ' default ' COMMENT ' Config Namespace Name ' ,
` ReleaseKey ` varchar ( 64 ) NOT NULL DEFAULT ' ' COMMENT ' 发布的Key ' ,
` ReleaseDeliveryTime ` timestamp NULL DEFAULT NULL COMMENT ' 配置获取时间 ' ,
` DataChange_CreatedTime ` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT ' 创建时间 ' ,
` DataChange_LastTime ` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT ' 最后修改时间 ' ,
PRIMARY KEY ( ` Id ` ) ,
UNIQUE KEY ` IX_UNIQUE_KEY ` ( ` InstanceId ` , ` ConfigAppId ` , ` ConfigNamespaceName ` ) ,
KEY ` IX_ReleaseKey ` ( ` ReleaseKey ` ) ,
KEY ` IX_DataChange_LastTime ` ( ` DataChange_LastTime ` ) ,
KEY ` IX_Valid_Namespace ` ( ` ConfigAppId ` , ` ConfigClusterName ` , ` ConfigNamespaceName ` , ` DataChange_LastTime ` )
` Id ` int ( 11 ) unsigned NOT NULL AUTO_INCREMENT COMMENT ' 自增Id ' ,
` InstanceId ` int ( 11 ) unsigned DEFAULT NULL COMMENT ' Instance Id ' ,
` ConfigAppId ` varchar ( 64 ) NOT NULL DEFAULT ' default ' COMMENT ' Config App Id ' ,
` ConfigClusterName ` varchar ( 32 ) NOT NULL DEFAULT ' default ' COMMENT ' Config Cluster Name ' ,
` ConfigNamespaceName ` varchar ( 32 ) NOT NULL DEFAULT ' default ' COMMENT ' Config Namespace Name ' ,
` ReleaseKey ` varchar ( 64 ) NOT NULL DEFAULT ' ' COMMENT ' 发布的Key ' ,
` ReleaseDeliveryTime ` timestamp NULL DEFAULT NULL COMMENT ' 配置获取时间 ' ,
` DataChange_CreatedTime ` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT ' 创建时间 ' ,
` DataChange_LastTime ` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT ' 最后修改时间 ' ,
PRIMARY KEY ( ` Id ` ) ,
UNIQUE KEY ` IX_UNIQUE_KEY ` ( ` InstanceId ` , ` ConfigAppId ` , ` ConfigNamespaceName ` ) ,
KEY ` IX_ReleaseKey ` ( ` ReleaseKey ` ) ,
KEY ` IX_DataChange_LastTime ` ( ` DataChange_LastTime ` ) ,
KEY ` IX_Valid_Namespace ` ( ` ConfigAppId ` , ` ConfigClusterName ` , ` ConfigNamespaceName ` , ` DataChange_LastTime ` )
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COMMENT = ' 应用实例的配置信息 ' ;
@ -223,20 +229,21 @@ CREATE TABLE `InstanceConfig` (
DROP TABLE IF EXISTS ` Item ` ;
CREATE TABLE ` Item ` (
` Id ` int ( 10 ) unsigned NOT NULL AUTO_INCREMENT COMMENT ' 自增Id ' ,
` NamespaceId ` int ( 10 ) unsigned NOT NULL DEFAULT ' 0 ' COMMENT ' 集群NamespaceId ' ,
` Key ` varchar ( 128 ) NOT NULL DEFAULT ' default ' COMMENT ' 配置项Key ' ,
` Value ` longtext NOT NULL COMMENT ' 配置项值 ' ,
` Comment ` varchar ( 1024 ) DEFAULT ' ' COMMENT ' 注释 ' ,
` LineNum ` int ( 10 ) unsigned DEFAULT ' 0 ' COMMENT ' 行号 ' ,
` IsDeleted ` bit ( 1 ) NOT NULL DEFAULT b ' 0 ' COMMENT ' 1: deleted, 0: normal ' ,
` DataChange_CreatedBy ` varchar ( 64 ) NOT NULL DEFAULT ' default ' COMMENT ' 创建人邮箱前缀 ' ,
` DataChange_CreatedTime ` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT ' 创建时间 ' ,
` DataChange_LastModifiedBy ` varchar ( 64 ) DEFAULT ' ' COMMENT ' 最后修改人邮箱前缀 ' ,
` DataChange_LastTime ` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT ' 最后修改时间 ' ,
PRIMARY KEY ( ` Id ` ) ,
KEY ` IX_GroupId ` ( ` NamespaceId ` ) ,
KEY ` DataChange_LastTime ` ( ` DataChange_LastTime ` )
` Id ` int ( 10 ) unsigned NOT NULL AUTO_INCREMENT COMMENT ' 自增Id ' ,
` NamespaceId ` int ( 10 ) unsigned NOT NULL DEFAULT ' 0 ' COMMENT ' 集群NamespaceId ' ,
` Key ` varchar ( 128 ) NOT NULL DEFAULT ' default ' COMMENT ' 配置项Key ' ,
` Value ` longtext NOT NULL COMMENT ' 配置项值 ' ,
` Comment ` varchar ( 1024 ) DEFAULT ' ' COMMENT ' 注释 ' ,
` LineNum ` int ( 10 ) unsigned DEFAULT ' 0 ' COMMENT ' 行号 ' ,
` IsDeleted ` bit ( 1 ) NOT NULL DEFAULT b ' 0 ' COMMENT ' 1: deleted, 0: normal ' ,
` DeletedAt ` BIGINT ( 20 ) NOT NULL DEFAULT ' 0 ' COMMENT ' Delete timestamp based on milliseconds ' ,
` DataChange_CreatedBy ` varchar ( 64 ) NOT NULL DEFAULT ' default ' COMMENT ' 创建人邮箱前缀 ' ,
` DataChange_CreatedTime ` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT ' 创建时间 ' ,
` DataChange_LastModifiedBy ` varchar ( 64 ) DEFAULT ' ' COMMENT ' 最后修改人邮箱前缀 ' ,
` DataChange_LastTime ` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT ' 最后修改时间 ' ,
PRIMARY KEY ( ` Id ` ) ,
KEY ` IX_GroupId ` ( ` NamespaceId ` ) ,
KEY ` DataChange_LastTime ` ( ` DataChange_LastTime ` )
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COMMENT = ' 配置项目 ' ;
@ -247,19 +254,20 @@ CREATE TABLE `Item` (
DROP TABLE IF EXISTS ` Namespace ` ;
CREATE TABLE ` Namespace ` (
` Id ` int ( 10 ) unsigned NOT NULL AUTO_INCREMENT COMMENT ' 自增主键 ' ,
` AppId ` varchar ( 500 ) NOT NULL DEFAULT ' default ' COMMENT ' AppID ' ,
` ClusterName ` varchar ( 500 ) NOT NULL DEFAULT ' default ' COMMENT ' Cluster Name ' ,
` NamespaceName ` varchar ( 500 ) NOT NULL DEFAULT ' default ' COMMENT ' Namespace Name ' ,
` IsDeleted ` bit ( 1 ) NOT NULL DEFAULT b ' 0 ' COMMENT ' 1: deleted, 0: normal ' ,
` DataChange_CreatedBy ` varchar ( 64 ) NOT NULL DEFAULT ' default ' COMMENT ' 创建人邮箱前缀 ' ,
` DataChange_CreatedTime ` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT ' 创建时间 ' ,
` DataChange_LastModifiedBy ` varchar ( 64 ) DEFAULT ' ' COMMENT ' 最后修改人邮箱前缀 ' ,
` DataChange_LastTime ` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT ' 最后修改时间 ' ,
PRIMARY KEY ( ` Id ` ) ,
KEY ` AppId_ClusterName_NamespaceName ` ( ` AppId ` ( 191 ) , ` ClusterName ` ( 191 ) , ` NamespaceName ` ( 191 ) ) ,
KEY ` DataChange_LastTime ` ( ` DataChange_LastTime ` ) ,
KEY ` IX_NamespaceName ` ( ` NamespaceName ` ( 191 ) )
` Id ` int ( 10 ) unsigned NOT NULL AUTO_INCREMENT COMMENT ' 自增主键 ' ,
` AppId ` varchar ( 500 ) NOT NULL DEFAULT ' default ' COMMENT ' AppID ' ,
` ClusterName ` varchar ( 500 ) NOT NULL DEFAULT ' default ' COMMENT ' Cluster Name ' ,
` NamespaceName ` varchar ( 500 ) NOT NULL DEFAULT ' default ' COMMENT ' Namespace Name ' ,
` IsDeleted ` bit ( 1 ) NOT NULL DEFAULT b ' 0 ' COMMENT ' 1: deleted, 0: normal ' ,
` DeletedAt ` BIGINT ( 20 ) NOT NULL DEFAULT ' 0 ' COMMENT ' Delete timestamp based on milliseconds ' ,
` DataChange_CreatedBy ` varchar ( 64 ) NOT NULL DEFAULT ' default ' COMMENT ' 创建人邮箱前缀 ' ,
` DataChange_CreatedTime ` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT ' 创建时间 ' ,
` DataChange_LastModifiedBy ` varchar ( 64 ) DEFAULT ' ' COMMENT ' 最后修改人邮箱前缀 ' ,
` DataChange_LastTime ` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT ' 最后修改时间 ' ,
PRIMARY KEY ( ` Id ` ) ,
UNIQUE KEY ` UK_AppId_ClusterName_NamespaceName_DeletedAt ` ( ` AppId ` ( 191 ) , ` ClusterName ` ( 191 ) , ` NamespaceName ` ( 191 ) , ` DeletedAt ` ) ,
KEY ` DataChange_LastTime ` ( ` DataChange_LastTime ` ) ,
KEY ` IX_NamespaceName ` ( ` NamespaceName ` ( 191 ) )
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COMMENT = ' 命名空间 ' ;
@ -270,16 +278,17 @@ CREATE TABLE `Namespace` (
DROP TABLE IF EXISTS ` NamespaceLock ` ;
CREATE TABLE ` NamespaceLock ` (
` Id ` int ( 11 ) unsigned NOT NULL AUTO_INCREMENT COMMENT ' 自增id ' ,
` NamespaceId ` int ( 10 ) unsigned NOT NULL DEFAULT ' 0 ' COMMENT ' 集群NamespaceId ' ,
` DataChange_CreatedBy ` varchar ( 64 ) NOT NULL DEFAULT ' default ' COMMENT ' 创建人邮箱前缀 ' ,
` DataChange_CreatedTime ` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT ' 创建时间 ' ,
` DataChange_LastModifiedBy ` varchar ( 64 ) DEFAULT ' ' COMMENT ' 最后修改人邮箱前缀 ' ,
` DataChange_LastTime ` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT ' 最后修改时间 ' ,
` IsDeleted ` bit ( 1 ) DEFAULT b ' 0 ' COMMENT ' 软删除 ' ,
PRIMARY KEY ( ` Id ` ) ,
UNIQUE KEY ` IX_NamespaceId ` ( ` NamespaceId ` ) ,
KEY ` DataChange_LastTime ` ( ` DataChange_LastTime ` )
` Id ` int ( 11 ) unsigned NOT NULL AUTO_INCREMENT COMMENT ' 自增id ' ,
` NamespaceId ` int ( 10 ) unsigned NOT NULL DEFAULT ' 0 ' COMMENT ' 集群NamespaceId ' ,
` DataChange_CreatedBy ` varchar ( 64 ) NOT NULL DEFAULT ' default ' COMMENT ' 创建人邮箱前缀 ' ,
` DataChange_CreatedTime ` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT ' 创建时间 ' ,
` DataChange_LastModifiedBy ` varchar ( 64 ) DEFAULT ' ' COMMENT ' 最后修改人邮箱前缀 ' ,
` DataChange_LastTime ` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT ' 最后修改时间 ' ,
` IsDeleted ` bit ( 1 ) DEFAULT b ' 0 ' COMMENT ' 软删除 ' ,
` DeletedAt ` BIGINT ( 20 ) NOT NULL DEFAULT ' 0 ' COMMENT ' Delete timestamp based on milliseconds ' ,
PRIMARY KEY ( ` Id ` ) ,
UNIQUE KEY ` UK_NamespaceId_DeletedAt ` ( ` NamespaceId ` , ` DeletedAt ` ) ,
KEY ` DataChange_LastTime ` ( ` DataChange_LastTime ` )
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COMMENT = ' namespace的编辑锁 ' ;
@ -290,24 +299,25 @@ CREATE TABLE `NamespaceLock` (
DROP TABLE IF EXISTS ` Release ` ;
CREATE TABLE ` Release ` (
` Id ` int ( 10 ) unsigned NOT NULL AUTO_INCREMENT COMMENT ' 自增主键 ' ,
` ReleaseKey ` varchar ( 64 ) NOT NULL DEFAULT ' ' COMMENT ' 发布的Key ' ,
` Name ` varchar ( 64 ) NOT NULL DEFAULT ' default ' COMMENT ' 发布名字 ' ,
` Comment ` varchar ( 256 ) DEFAULT NULL COMMENT ' 发布说明 ' ,
` AppId ` varchar ( 500 ) NOT NULL DEFAULT ' default ' COMMENT ' AppID ' ,
` ClusterName ` varchar ( 500 ) NOT NULL DEFAULT ' default ' COMMENT ' ClusterName ' ,
` NamespaceName ` varchar ( 500 ) NOT NULL DEFAULT ' default ' COMMENT ' namespaceName ' ,
` Configurations ` longtext NOT NULL COMMENT ' 发布配置 ' ,
` IsAbandoned ` bit ( 1 ) NOT NULL DEFAULT b ' 0 ' COMMENT ' 是否废弃 ' ,
` IsDeleted ` bit ( 1 ) NOT NULL DEFAULT b ' 0 ' COMMENT ' 1: deleted, 0: normal ' ,
` DataChange_CreatedBy ` varchar ( 64 ) NOT NULL DEFAULT ' default ' COMMENT ' 创建人邮箱前缀 ' ,
` DataChange_CreatedTime ` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT ' 创建时间 ' ,
` DataChange_LastModifiedBy ` varchar ( 64 ) DEFAULT ' ' COMMENT ' 最后修改人邮箱前缀 ' ,
` DataChange_LastTime ` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT ' 最后修改时间 ' ,
PRIMARY KEY ( ` Id ` ) ,
KEY ` AppId_ClusterName_GroupName ` ( ` AppId ` ( 191 ) , ` ClusterName ` ( 191 ) , ` NamespaceName ` ( 191 ) ) ,
KEY ` DataChange_LastTime ` ( ` DataChange_LastTime ` ) ,
KEY ` IX_ReleaseKey ` ( ` ReleaseKey ` )
` Id ` int ( 10 ) unsigned NOT NULL AUTO_INCREMENT COMMENT ' 自增主键 ' ,
` ReleaseKey ` varchar ( 64 ) NOT NULL DEFAULT ' ' COMMENT ' 发布的Key ' ,
` Name ` varchar ( 64 ) NOT NULL DEFAULT ' default ' COMMENT ' 发布名字 ' ,
` Comment ` varchar ( 256 ) DEFAULT NULL COMMENT ' 发布说明 ' ,
` AppId ` varchar ( 500 ) NOT NULL DEFAULT ' default ' COMMENT ' AppID ' ,
` ClusterName ` varchar ( 500 ) NOT NULL DEFAULT ' default ' COMMENT ' ClusterName ' ,
` NamespaceName ` varchar ( 500 ) NOT NULL DEFAULT ' default ' COMMENT ' namespaceName ' ,
` Configurations ` longtext NOT NULL COMMENT ' 发布配置 ' ,
` IsAbandoned ` bit ( 1 ) NOT NULL DEFAULT b ' 0 ' COMMENT ' 是否废弃 ' ,
` IsDeleted ` bit ( 1 ) NOT NULL DEFAULT b ' 0 ' COMMENT ' 1: deleted, 0: normal ' ,
` DeletedAt ` BIGINT ( 20 ) NOT NULL DEFAULT ' 0 ' COMMENT ' Delete timestamp based on milliseconds ' ,
` DataChange_CreatedBy ` varchar ( 64 ) NOT NULL DEFAULT ' default ' COMMENT ' 创建人邮箱前缀 ' ,
` DataChange_CreatedTime ` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT ' 创建时间 ' ,
` DataChange_LastModifiedBy ` varchar ( 64 ) DEFAULT ' ' COMMENT ' 最后修改人邮箱前缀 ' ,
` DataChange_LastTime ` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT ' 最后修改时间 ' ,
PRIMARY KEY ( ` Id ` ) ,
UNIQUE KEY ` UK_ReleaseKey_DeletedAt ` ( ` ReleaseKey ` , ` DeletedAt ` ) ,
KEY ` AppId_ClusterName_GroupName ` ( ` AppId ` ( 191 ) , ` ClusterName ` ( 191 ) , ` NamespaceName ` ( 191 ) ) ,
KEY ` DataChange_LastTime ` ( ` DataChange_LastTime ` )
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COMMENT = ' 发布 ' ;
@ -317,24 +327,25 @@ CREATE TABLE `Release` (
DROP TABLE IF EXISTS ` ReleaseHistory ` ;
CREATE TABLE ` ReleaseHistory ` (
` Id ` int ( 11 ) unsigned NOT NULL AUTO_INCREMENT COMMENT ' 自增Id ' ,
` AppId ` varchar ( 64 ) NOT NULL DEFAULT ' default ' COMMENT ' AppID ' ,
` ClusterName ` varchar ( 32 ) NOT NULL DEFAULT ' default ' COMMENT ' ClusterName ' ,
` NamespaceName ` varchar ( 32 ) NOT NULL DEFAULT ' default ' COMMENT ' namespaceName ' ,
` BranchName ` varchar ( 32 ) NOT NULL DEFAULT ' default ' COMMENT ' 发布分支名 ' ,
` ReleaseId ` int ( 11 ) unsigned NOT NULL DEFAULT ' 0 ' COMMENT ' 关联的Release Id ' ,
` PreviousReleaseId ` int ( 11 ) unsigned NOT NULL DEFAULT ' 0 ' COMMENT ' 前一次发布的ReleaseId ' ,
` Operation ` tinyint ( 3 ) unsigned NOT NULL DEFAULT ' 0 ' COMMENT ' 发布类型, 0: 普通发布, 1: 回滚, 2: 灰度发布, 3: 灰度规则更新, 4: 灰度合并回主分支发布, 5: 主分支发布灰度自动发布, 6: 主分支回滚灰度自动发布, 7: 放弃灰度 ' ,
` OperationContext ` longtext NOT NULL COMMENT ' 发布上下文信息 ' ,
` IsDeleted ` bit ( 1 ) NOT NULL DEFAULT b ' 0 ' COMMENT ' 1: deleted, 0: normal ' ,
` DataChange_CreatedBy ` varchar ( 64 ) NOT NULL DEFAULT ' default ' COMMENT ' 创建人邮箱前缀 ' ,
` DataChange_CreatedTime ` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT ' 创建时间 ' ,
` DataChange_LastModifiedBy ` varchar ( 64 ) DEFAULT ' ' COMMENT ' 最后修改人邮箱前缀 ' ,
` DataChange_LastTime ` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT ' 最后修改时间 ' ,
PRIMARY KEY ( ` Id ` ) ,
KEY ` IX_Namespace ` ( ` AppId ` , ` ClusterName ` , ` NamespaceName ` , ` BranchName ` ) ,
KEY ` IX_ReleaseId ` ( ` ReleaseId ` ) ,
KEY ` IX_DataChange_LastTime ` ( ` DataChange_LastTime ` )
` Id ` int ( 11 ) unsigned NOT NULL AUTO_INCREMENT COMMENT ' 自增Id ' ,
` AppId ` varchar ( 64 ) NOT NULL DEFAULT ' default ' COMMENT ' AppID ' ,
` ClusterName ` varchar ( 32 ) NOT NULL DEFAULT ' default ' COMMENT ' ClusterName ' ,
` NamespaceName ` varchar ( 32 ) NOT NULL DEFAULT ' default ' COMMENT ' namespaceName ' ,
` BranchName ` varchar ( 32 ) NOT NULL DEFAULT ' default ' COMMENT ' 发布分支名 ' ,
` ReleaseId ` int ( 11 ) unsigned NOT NULL DEFAULT ' 0 ' COMMENT ' 关联的Release Id ' ,
` PreviousReleaseId ` int ( 11 ) unsigned NOT NULL DEFAULT ' 0 ' COMMENT ' 前一次发布的ReleaseId ' ,
` Operation ` tinyint ( 3 ) unsigned NOT NULL DEFAULT ' 0 ' COMMENT ' 发布类型, 0: 普通发布, 1: 回滚, 2: 灰度发布, 3: 灰度规则更新, 4: 灰度合并回主分支发布, 5: 主分支发布灰度自动发布, 6: 主分支回滚灰度自动发布, 7: 放弃灰度 ' ,
` OperationContext ` longtext NOT NULL COMMENT ' 发布上下文信息 ' ,
` IsDeleted ` bit ( 1 ) NOT NULL DEFAULT b ' 0 ' COMMENT ' 1: deleted, 0: normal ' ,
` DeletedAt ` BIGINT ( 20 ) NOT NULL DEFAULT ' 0 ' COMMENT ' Delete timestamp based on milliseconds ' ,
` DataChange_CreatedBy ` varchar ( 64 ) NOT NULL DEFAULT ' default ' COMMENT ' 创建人邮箱前缀 ' ,
` DataChange_CreatedTime ` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT ' 创建时间 ' ,
` DataChange_LastModifiedBy ` varchar ( 64 ) DEFAULT ' ' COMMENT ' 最后修改人邮箱前缀 ' ,
` DataChange_LastTime ` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT ' 最后修改时间 ' ,
PRIMARY KEY ( ` Id ` ) ,
KEY ` IX_Namespace ` ( ` AppId ` , ` ClusterName ` , ` NamespaceName ` , ` BranchName ` ) ,
KEY ` IX_ReleaseId ` ( ` ReleaseId ` ) ,
KEY ` IX_DataChange_LastTime ` ( ` DataChange_LastTime ` )
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COMMENT = ' 发布历史 ' ;
@ -344,12 +355,12 @@ CREATE TABLE `ReleaseHistory` (
DROP TABLE IF EXISTS ` ReleaseMessage ` ;
CREATE TABLE ` ReleaseMessage ` (
` Id ` int ( 11 ) unsigned NOT NULL AUTO_INCREMENT COMMENT ' 自增主键 ' ,
` Message ` varchar ( 1024 ) NOT NULL DEFAULT ' ' COMMENT ' 发布的消息内容 ' ,
` DataChange_LastTime ` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT ' 最后修改时间 ' ,
PRIMARY KEY ( ` Id ` ) ,
KEY ` DataChange_LastTime ` ( ` DataChange_LastTime ` ) ,
KEY ` IX_Message ` ( ` Message ` ( 191 ) )
` Id ` int ( 11 ) unsigned NOT NULL AUTO_INCREMENT COMMENT ' 自增主键 ' ,
` Message ` varchar ( 1024 ) NOT NULL DEFAULT ' ' COMMENT ' 发布的消息内容 ' ,
` DataChange_LastTime ` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT ' 最后修改时间 ' ,
PRIMARY KEY ( ` Id ` ) ,
KEY ` DataChange_LastTime ` ( ` DataChange_LastTime ` ) ,
KEY ` IX_Message ` ( ` Message ` ( 191 ) )
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COMMENT = ' 发布消息 ' ;
@ -360,19 +371,20 @@ CREATE TABLE `ReleaseMessage` (
DROP TABLE IF EXISTS ` ServerConfig ` ;
CREATE TABLE ` ServerConfig ` (
` Id ` int ( 10 ) unsigned NOT NULL AUTO_INCREMENT COMMENT ' 自增Id ' ,
` Key ` varchar ( 64 ) NOT NULL DEFAULT ' default ' COMMENT ' 配置项Key ' ,
` Cluster ` varchar ( 32 ) NOT NULL DEFAULT ' default ' COMMENT ' 配置对应的集群, default为不针对特定的集群 ' ,
` Value ` varchar ( 2048 ) NOT NULL DEFAULT ' default ' COMMENT ' 配置项值 ' ,
` Comment ` varchar ( 1024 ) DEFAULT ' ' COMMENT ' 注释 ' ,
` IsDeleted ` bit ( 1 ) NOT NULL DEFAULT b ' 0 ' COMMENT ' 1: deleted, 0: normal ' ,
` DataChange_CreatedBy ` varchar ( 64 ) NOT NULL DEFAULT ' default ' COMMENT ' 创建人邮箱前缀 ' ,
` DataChange_CreatedTime ` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT ' 创建时间 ' ,
` DataChange_LastModifiedBy ` varchar ( 64 ) DEFAULT ' ' COMMENT ' 最后修改人邮箱前缀 ' ,
` DataChange_LastTime ` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT ' 最后修改时间 ' ,
PRIMARY KEY ( ` Id ` ) ,
KEY ` IX_Key ` ( ` Key ` ) ,
KEY ` DataChange_LastTime ` ( ` DataChange_LastTime ` )
` Id ` int ( 10 ) unsigned NOT NULL AUTO_INCREMENT COMMENT ' 自增Id ' ,
` Key ` varchar ( 64 ) NOT NULL DEFAULT ' default ' COMMENT ' 配置项Key ' ,
` Cluster ` varchar ( 32 ) NOT NULL DEFAULT ' default ' COMMENT ' 配置对应的集群, default为不针对特定的集群 ' ,
` Value ` varchar ( 2048 ) NOT NULL DEFAULT ' default ' COMMENT ' 配置项值 ' ,
` Comment ` varchar ( 1024 ) DEFAULT ' ' COMMENT ' 注释 ' ,
` IsDeleted ` bit ( 1 ) NOT NULL DEFAULT b ' 0 ' COMMENT ' 1: deleted, 0: normal ' ,
` DeletedAt ` BIGINT ( 20 ) NOT NULL DEFAULT ' 0 ' COMMENT ' Delete timestamp based on milliseconds ' ,
` DataChange_CreatedBy ` varchar ( 64 ) NOT NULL DEFAULT ' default ' COMMENT ' 创建人邮箱前缀 ' ,
` DataChange_CreatedTime ` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT ' 创建时间 ' ,
` DataChange_LastModifiedBy ` varchar ( 64 ) DEFAULT ' ' COMMENT ' 最后修改人邮箱前缀 ' ,
` DataChange_LastTime ` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT ' 最后修改时间 ' ,
PRIMARY KEY ( ` Id ` ) ,
UNIQUE KEY ` UK_Key_Cluster_DeletedAt ` ( ` Key ` , ` Cluster ` , ` DeletedAt ` ) ,
KEY ` DataChange_LastTime ` ( ` DataChange_LastTime ` )
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COMMENT = ' 配置服务自身配置 ' ;
# Dump of table accesskey
@ -381,18 +393,19 @@ CREATE TABLE `ServerConfig` (
DROP TABLE IF EXISTS ` AccessKey ` ;
CREATE TABLE ` AccessKey ` (
` Id ` int ( 10 ) unsigned NOT NULL AUTO_INCREMENT COMMENT ' 自增主键 ' ,
` AppId ` varchar ( 500 ) NOT NULL DEFAULT ' default ' COMMENT ' AppID ' ,
` Secret ` varchar ( 128 ) NOT NULL DEFAULT ' ' COMMENT ' Secret ' ,
` IsEnabled ` bit ( 1 ) NOT NULL DEFAULT b ' 0 ' COMMENT ' 1: enabled, 0: disabled ' ,
` IsDeleted ` bit ( 1 ) NOT NULL DEFAULT b ' 0 ' COMMENT ' 1: deleted, 0: normal ' ,
` DataChange_CreatedBy ` varchar ( 64 ) NOT NULL DEFAULT ' default ' COMMENT ' 创建人邮箱前缀 ' ,
` DataChange_CreatedTime ` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT ' 创建时间 ' ,
` DataChange_LastModifiedBy ` varchar ( 64 ) DEFAULT ' ' COMMENT ' 最后修改人邮箱前缀 ' ,
` DataChange_LastTime ` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT ' 最后修改时间 ' ,
PRIMARY KEY ( ` Id ` ) ,
KEY ` AppId ` ( ` AppId ` ( 191 ) ) ,
KEY ` DataChange_LastTime ` ( ` DataChange_LastTime ` )
` Id ` int ( 10 ) unsigned NOT NULL AUTO_INCREMENT COMMENT ' 自增主键 ' ,
` AppId ` varchar ( 500 ) NOT NULL DEFAULT ' default ' COMMENT ' AppID ' ,
` Secret ` varchar ( 128 ) NOT NULL DEFAULT ' ' COMMENT ' Secret ' ,
` IsEnabled ` bit ( 1 ) NOT NULL DEFAULT b ' 0 ' COMMENT ' 1: enabled, 0: disabled ' ,
` IsDeleted ` bit ( 1 ) NOT NULL DEFAULT b ' 0 ' COMMENT ' 1: deleted, 0: normal ' ,
` DeletedAt ` BIGINT ( 20 ) NOT NULL DEFAULT ' 0 ' COMMENT ' Delete timestamp based on milliseconds ' ,
` DataChange_CreatedBy ` varchar ( 64 ) NOT NULL DEFAULT ' default ' COMMENT ' 创建人邮箱前缀 ' ,
` DataChange_CreatedTime ` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT ' 创建时间 ' ,
` DataChange_LastModifiedBy ` varchar ( 64 ) DEFAULT ' ' COMMENT ' 最后修改人邮箱前缀 ' ,
` DataChange_LastTime ` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT ' 最后修改时间 ' ,
PRIMARY KEY ( ` Id ` ) ,
UNIQUE KEY ` UK_AppId_Secret_DeletedAt ` ( ` AppId ` , ` Secret ` , ` DeletedAt ` ) ,
KEY ` DataChange_LastTime ` ( ` DataChange_LastTime ` )
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COMMENT = ' 访问密钥 ' ;
# Config
@ -413,36 +426,36 @@ VALUES
INSERT INTO ` AppNamespace ` ( ` Name ` , ` AppId ` , ` Format ` , ` IsPublic ` , ` Comment ` )
VALUES
( ' application ' , ' SampleApp ' , ' properties ' , 0 , ' default app namespace ' ) ;
( ' application ' , ' SampleApp ' , ' properties ' , 0 , ' default app namespace ' ) ;
INSERT INTO ` Cluster ` ( ` Name ` , ` AppId ` )
VALUES
( ' default ' , ' SampleApp ' ) ;
( ' default ' , ' SampleApp ' ) ;
INSERT INTO ` Namespace ` ( ` Id ` , ` AppId ` , ` ClusterName ` , ` NamespaceName ` )
VALUES
( 1 , ' SampleApp ' , ' default ' , ' application ' ) ;
( 1 , ' SampleApp ' , ' default ' , ' application ' ) ;
INSERT INTO ` Item ` ( ` NamespaceId ` , ` Key ` , ` Value ` , ` Comment ` , ` LineNum ` )
VALUES
( 1 , ' timeout ' , ' 100 ' , ' sample timeout配置 ' , 1 ) ;
( 1 , ' timeout ' , ' 100 ' , ' sample timeout配置 ' , 1 ) ;
INSERT INTO ` Release ` ( ` ReleaseKey ` , ` Name ` , ` Comment ` , ` AppId ` , ` ClusterName ` , ` NamespaceName ` , ` Configurations ` )
VALUES
( ' 20161009155425-d3a0749c6e20bc15 ' , ' 20161009155424-release ' , ' Sample发布 ' , ' SampleApp ' , ' default ' , ' application ' , ' {\"timeout\":\"100\"} ' ) ;
( ' 20161009155425-d3a0749c6e20bc15 ' , ' 20161009155424-release ' , ' Sample发布 ' , ' SampleApp ' , ' default ' , ' application ' , ' {\"timeout\":\"100\"} ' ) ;
INSERT INTO ` ReleaseHistory ` ( ` AppId ` , ` ClusterName ` , ` NamespaceName ` , ` BranchName ` , ` ReleaseId ` , ` PreviousReleaseId ` , ` Operation ` , ` OperationContext ` , ` DataChange_CreatedBy ` , ` DataChange_LastModifiedBy ` )
VALUES
( ' SampleApp ' , ' default ' , ' application ' , ' default ' , 1 , 0 , 0 , ' {} ' , ' apollo ' , ' apollo ' ) ;
( ' SampleApp ' , ' default ' , ' application ' , ' default ' , 1 , 0 , 0 , ' {} ' , ' apollo ' , ' apollo ' ) ;
INSERT INTO ` ReleaseMessage ` ( ` Message ` )
VALUES
( ' SampleApp+default+application ' ) ;
( ' SampleApp+default+application ' ) ;
/* !40111 SET SQL_NOTES=@OLD_SQL_NOTES */ ;
/* !40101 SET SQL_MODE=@OLD_SQL_MODE */ ;
/* !40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */ ;
/* !40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */ ;
/* !40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */ ;
/* !40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */ ;
/* !40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */ ;