From 28df335eb635926281bc9dc0f0419b5fd3eaada1 Mon Sep 17 00:00:00 2001 From: Jason Song Date: Mon, 21 Nov 2022 23:38:44 +0800 Subject: [PATCH] merge the service registry delta sql to v200-v210 as 2.1.0 is not released (#4653) fix https://github.com/apolloconfig/apollo/pull/4595 --- .../v200-v210/apolloconfigdb-v200-v210.sql | 13 ++++++++ .../v210-v220/apolloconfigdb-v210-v220.sql | 31 ------------------- 2 files changed, 13 insertions(+), 31 deletions(-) delete mode 100644 scripts/sql/delta/v210-v220/apolloconfigdb-v210-v220.sql diff --git a/scripts/sql/delta/v200-v210/apolloconfigdb-v200-v210.sql b/scripts/sql/delta/v200-v210/apolloconfigdb-v200-v210.sql index b6bef72d454..e5c16a41c5c 100644 --- a/scripts/sql/delta/v200-v210/apolloconfigdb-v200-v210.sql +++ b/scripts/sql/delta/v200-v210/apolloconfigdb-v200-v210.sql @@ -22,3 +22,16 @@ CREATE INDEX IX_PreviousReleaseId ON ReleaseHistory(PreviousReleaseId); ALTER TABLE `Item` ADD COLUMN `Type` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '配置项类型,0: String,1: Number,2: Boolean,3: JSON' AFTER `Key`; + +CREATE TABLE `ServiceRegistry` ( + `Id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '自增Id', + `ServiceName` VARCHAR(64) NOT NULL COMMENT '服务名', + `Uri` VARCHAR(64) NOT NULL COMMENT '服务地址', + `Cluster` VARCHAR(64) NOT NULL COMMENT '集群,可以用来标识apollo.cluster或者网络分区', + `Metadata` VARCHAR(1024) NOT NULL DEFAULT '{}' COMMENT '元数据,key value结构的json object,为了方面后面扩展功能而不需要修改表结构', + `DataChange_CreatedTime` TIMESTAMP NOT NULL COMMENT '创建时间', + `DataChange_LastTime` TIMESTAMP NOT NULL COMMENT '最后修改时间', + PRIMARY KEY (`Id`), + UNIQUE INDEX `IX_UNIQUE_KEY` (`ServiceName`, `Uri`), + INDEX `IX_DataChange_LastTime` (`DataChange_LastTime`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='注册中心'; \ No newline at end of file diff --git a/scripts/sql/delta/v210-v220/apolloconfigdb-v210-v220.sql b/scripts/sql/delta/v210-v220/apolloconfigdb-v210-v220.sql deleted file mode 100644 index 78e686abd8b..00000000000 --- a/scripts/sql/delta/v210-v220/apolloconfigdb-v210-v220.sql +++ /dev/null @@ -1,31 +0,0 @@ --- --- Copyright 2022 Apollo Authors --- --- Licensed under the Apache License, Version 2.0 (the "License"); --- you may not use this file except in compliance with the License. --- You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, software --- distributed under the License is distributed on an "AS IS" BASIS, --- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --- See the License for the specific language governing permissions and --- limitations under the License. --- -# delta schema to upgrade apollo config db from v2.1.0 to v2.2.0 - -Use ApolloConfigDB; - -CREATE TABLE `ServiceRegistry` ( - `Id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '自增Id', - `ServiceName` VARCHAR(64) NOT NULL COMMENT '服务名', - `Uri` VARCHAR(64) NOT NULL COMMENT '服务地址', - `Cluster` VARCHAR(64) NOT NULL COMMENT '集群,可以用来标识apollo.cluster或者网络分区', - `Metadata` VARCHAR(1024) NOT NULL DEFAULT '{}' COMMENT '元数据,key value结构的json object,为了方面后面扩展功能而不需要修改表结构', - `DataChange_CreatedTime` TIMESTAMP NOT NULL COMMENT '创建时间', - `DataChange_LastTime` TIMESTAMP NOT NULL COMMENT '最后修改时间', - PRIMARY KEY (`Id`), - UNIQUE INDEX `IX_UNIQUE_KEY` (`ServiceName`, `Uri`), - INDEX `IX_DataChange_LastTime` (`DataChange_LastTime`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='注册中心'; \ No newline at end of file