diff --git a/CHANGES.md b/CHANGES.md index e8b177f2718..3b21d406791 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -9,6 +9,7 @@ Apollo 2.2.0 * [Bump springcloud springboot version to solve cve problems](https://github.com/apolloconfig/apollo/pull/4712) * [rename mysql-connector-java to mysql-connector-j](https://github.com/apolloconfig/apollo/pull/4748) * [Bump springboot version from 2.7.8 to 2.7.9](https://github.com/apolloconfig/apollo/pull/4750) +* [[Multi-Database Support] Without Reliance on globally_quoted_identifiers Variable](https://github.com/apolloconfig/apollo/pull/4749) ------------------ All issues and pull requests are [here](https://github.com/apolloconfig/apollo/milestone/13?closed=1) \ No newline at end of file diff --git a/apollo-adminservice/src/test/resources/controller/cleanup.sql b/apollo-adminservice/src/test/resources/controller/cleanup.sql index f81af59a17b..92e7c8d448b 100644 --- a/apollo-adminservice/src/test/resources/controller/cleanup.sql +++ b/apollo-adminservice/src/test/resources/controller/cleanup.sql @@ -14,8 +14,8 @@ -- limitations under the License. -- DELETE FROM Item; -DELETE FROM Namespace; -DELETE FROM AppNamespace; +DELETE FROM "Namespace"; +DELETE FROM "AppNamespace"; DELETE FROM Cluster; DELETE FROM App; DELETE FROM NamespaceLock; diff --git a/apollo-adminservice/src/test/resources/controller/test-itemset.sql b/apollo-adminservice/src/test/resources/controller/test-itemset.sql index 6830ec12b5a..59cc609a2ab 100644 --- a/apollo-adminservice/src/test/resources/controller/test-itemset.sql +++ b/apollo-adminservice/src/test/resources/controller/test-itemset.sql @@ -17,10 +17,10 @@ INSERT INTO App (AppId, Name, OwnerName, OwnerEmail) VALUES ('someAppId','someAp INSERT INTO Cluster (AppId, Name) VALUES ('someAppId', 'default'); -INSERT INTO AppNamespace (AppId, Name) VALUES ('someAppId', 'application'); +INSERT INTO "AppNamespace" (AppId, Name) VALUES ('someAppId', 'application'); -INSERT INTO AppNamespace (AppId, Name) VALUES ('someAppId', 'someNamespace'); +INSERT INTO "AppNamespace" (AppId, Name) VALUES ('someAppId', 'someNamespace'); -INSERT INTO Namespace (AppId, ClusterName, NamespaceName) VALUES ('someAppId', 'default', 'application'); +INSERT INTO "Namespace" (AppId, ClusterName, NamespaceName) VALUES ('someAppId', 'default', 'application'); -INSERT INTO Namespace (AppId, ClusterName, NamespaceName) VALUES ('someAppId', 'default', 'someNamespace'); +INSERT INTO "Namespace" (AppId, ClusterName, NamespaceName) VALUES ('someAppId', 'default', 'someNamespace'); diff --git a/apollo-adminservice/src/test/resources/controller/test-release.sql b/apollo-adminservice/src/test/resources/controller/test-release.sql index 5d9c8f714d4..01e883948fc 100644 --- a/apollo-adminservice/src/test/resources/controller/test-release.sql +++ b/apollo-adminservice/src/test/resources/controller/test-release.sql @@ -17,9 +17,9 @@ INSERT INTO App (AppId, Name, OwnerName, OwnerEmail) VALUES ('someAppId','someAp INSERT INTO Cluster (AppId, Name) VALUES ('someAppId', 'default'); -INSERT INTO AppNamespace (AppId, Name) VALUES ('someAppId', 'application'); +INSERT INTO "AppNamespace" (AppId, Name) VALUES ('someAppId', 'application'); -INSERT INTO Namespace (Id, AppId, ClusterName, NamespaceName) VALUES (100, 'someAppId', 'default', 'application'); +INSERT INTO "Namespace" (Id, AppId, ClusterName, NamespaceName) VALUES (100, 'someAppId', 'default', 'application'); INSERT INTO Item (NamespaceId, "Key", "Type", "Value", Comment) VALUES (100, 'k1', '0', 'v1', 'comment1'); INSERT INTO Item (NamespaceId, "Key", "Type", "Value", Comment) VALUES (100, 'k2', '0', 'v2', 'comment1'); diff --git a/apollo-adminservice/src/test/resources/data.sql b/apollo-adminservice/src/test/resources/data.sql index 9d275bd023b..bb831318add 100644 --- a/apollo-adminservice/src/test/resources/data.sql +++ b/apollo-adminservice/src/test/resources/data.sql @@ -26,23 +26,23 @@ INSERT INTO Cluster (AppId, Name) VALUES ('100003173', 'default'); INSERT INTO Cluster (AppId, Name) VALUES ('100003173', 'cluster3'); INSERT INTO Cluster (AppId, Name) VALUES ('fxhermesproducer', 'default'); -INSERT INTO AppNamespace (AppId, Name) VALUES ('100003171', 'application'); -INSERT INTO AppNamespace (AppId, Name) VALUES ('100003171', 'fx.apollo.config'); -INSERT INTO AppNamespace (AppId, Name) VALUES ('100003172', 'application'); -INSERT INTO AppNamespace (AppId, Name) VALUES ('100003172', 'fx.apollo.admin'); -INSERT INTO AppNamespace (AppId, Name) VALUES ('100003173', 'application'); -INSERT INTO AppNamespace (AppId, Name) VALUES ('100003173', 'fx.apollo.portal'); -INSERT INTO AppNamespace (AppID, Name) VALUES ('fxhermesproducer', 'fx.hermes.producer'); +INSERT INTO "AppNamespace" (AppId, Name) VALUES ('100003171', 'application'); +INSERT INTO "AppNamespace" (AppId, Name) VALUES ('100003171', 'fx.apollo.config'); +INSERT INTO "AppNamespace" (AppId, Name) VALUES ('100003172', 'application'); +INSERT INTO "AppNamespace" (AppId, Name) VALUES ('100003172', 'fx.apollo.admin'); +INSERT INTO "AppNamespace" (AppId, Name) VALUES ('100003173', 'application'); +INSERT INTO "AppNamespace" (AppId, Name) VALUES ('100003173', 'fx.apollo.portal'); +INSERT INTO "AppNamespace" (AppID, Name) VALUES ('fxhermesproducer', 'fx.hermes.producer'); -INSERT INTO Namespace (Id, AppId, ClusterName, NamespaceName) VALUES (1, '100003171', 'default', 'application'); -INSERT INTO Namespace (Id, AppId, ClusterName, NamespaceName) VALUES (5, '100003171', 'cluster1', 'application'); -INSERT INTO Namespace (Id, AppId, ClusterName, NamespaceName) VALUES (2, 'fxhermesproducer', 'default', 'fx.hermes.producer'); -INSERT INTO Namespace (Id, AppId, ClusterName, NamespaceName) VALUES (3, '100003172', 'default', 'application'); -INSERT INTO Namespace (Id, AppId, ClusterName, NamespaceName) VALUES (4, '100003173', 'default', 'application'); +INSERT INTO "Namespace" (Id, AppId, ClusterName, NamespaceName) VALUES (1, '100003171', 'default', 'application'); +INSERT INTO "Namespace" (Id, AppId, ClusterName, NamespaceName) VALUES (5, '100003171', 'cluster1', 'application'); +INSERT INTO "Namespace" (Id, AppId, ClusterName, NamespaceName) VALUES (2, 'fxhermesproducer', 'default', 'fx.hermes.producer'); +INSERT INTO "Namespace" (Id, AppId, ClusterName, NamespaceName) VALUES (3, '100003172', 'default', 'application'); +INSERT INTO "Namespace" (Id, AppId, ClusterName, NamespaceName) VALUES (4, '100003173', 'default', 'application'); INSERT INTO Item (NamespaceId, "Key", "Value", Comment) VALUES (1, 'k1', 'v1', 'comment1'); INSERT INTO Item (NamespaceId, "Key", "Value", Comment) VALUES (1, 'k2', 'v2', 'comment2'); INSERT INTO Item (NamespaceId, "Key", "Value", Comment) VALUES (2, 'k3', 'v3', 'comment3'); INSERT INTO Item (NamespaceId, "Key", "Value", Comment, LineNum) VALUES (5, 'k1', 'v4', 'comment4',1); -INSERT INTO RELEASE (ReleaseKey, Name, Comment, AppId, ClusterName, NamespaceName, Configurations) VALUES ('TEST-RELEASE-KEY', 'REV1','First Release','100003171', 'default', 'application', '{"k1":"v1"}'); +INSERT INTO "Release" (ReleaseKey, Name, Comment, AppId, ClusterName, NamespaceName, Configurations) VALUES ('TEST-RELEASE-KEY', 'REV1','First Release','100003171', 'default', 'application', '{"k1":"v1"}'); diff --git a/apollo-adminservice/src/test/resources/import.sql b/apollo-adminservice/src/test/resources/import.sql index a73f48e5088..1e0844a6e02 100644 --- a/apollo-adminservice/src/test/resources/import.sql +++ b/apollo-adminservice/src/test/resources/import.sql @@ -17,18 +17,18 @@ ALTER TABLE APP ALTER COLUMN DataChange_CreatedBy VARCHAR(255) NULL; ALTER TABLE APP ALTER COLUMN DataChange_CreatedTime TIMESTAMP NULL; ALTER TABLE APP ALTER COLUMN ORGNAME VARCHAR(255) NULL; ALTER TABLE APP ALTER COLUMN ORGID VARCHAR(255) NULL; -ALTER TABLE AppNamespace ALTER COLUMN DataChange_CreatedBy VARCHAR(255) NULL; -ALTER TABLE AppNamespace ALTER COLUMN DataChange_CreatedTime TIMESTAMP NULL; -ALTER TABLE AppNamespace ALTER COLUMN Format VARCHAR(255) NULL; +ALTER TABLE "AppNamespace" ALTER COLUMN DataChange_CreatedBy VARCHAR(255) NULL; +ALTER TABLE "AppNamespace" ALTER COLUMN DataChange_CreatedTime TIMESTAMP NULL; +ALTER TABLE "AppNamespace" ALTER COLUMN Format VARCHAR(255) NULL; ALTER TABLE Cluster ALTER COLUMN DataChange_CreatedBy VARCHAR(255) NULL; ALTER TABLE Cluster ALTER COLUMN DataChange_CreatedTime TIMESTAMP NULL; ALTER TABLE Cluster ALTER COLUMN ParentClusterId BIGINT DEFAULT 0; -ALTER TABLE Namespace ALTER COLUMN DataChange_CreatedBy VARCHAR(255) NULL; -ALTER TABLE Namespace ALTER COLUMN DataChange_CreatedTime TIMESTAMP NULL; +ALTER TABLE "Namespace" ALTER COLUMN DataChange_CreatedBy VARCHAR(255) NULL; +ALTER TABLE "Namespace" ALTER COLUMN DataChange_CreatedTime TIMESTAMP NULL; ALTER TABLE Item ALTER COLUMN DataChange_CreatedBy VARCHAR(255) NULL; ALTER TABLE Item ALTER COLUMN DataChange_CreatedTime TIMESTAMP NULL; -ALTER TABLE RELEASE ALTER COLUMN DataChange_CreatedBy VARCHAR(255) NULL; -ALTER TABLE RELEASE ALTER COLUMN DataChange_CreatedTime TIMESTAMP NULL; +ALTER TABLE "Release" ALTER COLUMN DataChange_CreatedBy VARCHAR(255) NULL; +ALTER TABLE "Release" ALTER COLUMN DataChange_CreatedTime TIMESTAMP NULL; ALTER TABLE ServerConfig ALTER COLUMN DataChange_CreatedBy VARCHAR(255) NULL; ALTER TABLE ServerConfig ALTER COLUMN DataChange_CreatedTime TIMESTAMP NULL; ALTER TABLE ServerConfig ALTER COLUMN COMMENT VARCHAR(255) NULL; diff --git a/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/entity/Namespace.java b/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/entity/Namespace.java index 869e582d104..7306a6e2ba0 100644 --- a/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/entity/Namespace.java +++ b/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/entity/Namespace.java @@ -26,7 +26,7 @@ import javax.persistence.Table; @Entity -@Table(name = "Namespace") +@Table(name = "`Namespace`") @SQLDelete(sql = "Update Namespace set IsDeleted = 1, DeletedAt = ROUND(UNIX_TIMESTAMP(NOW(4))*1000) where Id = ?") @Where(clause = "isDeleted = 0") public class Namespace extends BaseEntity { diff --git a/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/entity/Release.java b/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/entity/Release.java index d6099279c40..52db840cd7d 100644 --- a/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/entity/Release.java +++ b/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/entity/Release.java @@ -30,7 +30,7 @@ * @author Jason Song(song_s@ctrip.com) */ @Entity -@Table(name = "Release") +@Table(name = "`Release`") @SQLDelete(sql = "Update Release set IsDeleted = 1, DeletedAt = ROUND(UNIX_TIMESTAMP(NOW(4))*1000) where Id = ?") @Where(clause = "isDeleted = 0") public class Release extends BaseEntity { diff --git a/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/entity/ReleaseMessage.java b/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/entity/ReleaseMessage.java index ff153b0d709..570adf8b109 100644 --- a/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/entity/ReleaseMessage.java +++ b/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/entity/ReleaseMessage.java @@ -32,7 +32,7 @@ * @author Jason Song(song_s@ctrip.com) */ @Entity -@Table(name = "ReleaseMessage") +@Table(name = "`ReleaseMessage`") public class ReleaseMessage { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) diff --git a/apollo-biz/src/test/resources/data.sql b/apollo-biz/src/test/resources/data.sql index 37aad55eb7d..03544d52830 100644 --- a/apollo-biz/src/test/resources/data.sql +++ b/apollo-biz/src/test/resources/data.sql @@ -13,10 +13,10 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- -INSERT INTO AppNamespace (AppId, Name, IsPublic) VALUES ('100003171', 'application', false); -INSERT INTO AppNamespace (AppId, Name, IsPublic) VALUES ('100003171', 'fx.apollo.config', true); -INSERT INTO AppNamespace (AppId, Name, IsPublic) VALUES ('100003172', 'application', false); -INSERT INTO AppNamespace (AppId, Name, IsPublic) VALUES ('100003172', 'fx.apollo.admin', true); -INSERT INTO AppNamespace (AppId, Name, IsPublic) VALUES ('100003173', 'application', false); -INSERT INTO AppNamespace (AppId, Name, IsPublic) VALUES ('100003173', 'fx.apollo.portal', true); -INSERT INTO AppNamespace (AppID, Name, IsPublic) VALUES ('fxhermesproducer', 'fx.hermes.producer', true); +INSERT INTO "AppNamespace" (AppId, Name, IsPublic) VALUES ('100003171', 'application', false); +INSERT INTO "AppNamespace" (AppId, Name, IsPublic) VALUES ('100003171', 'fx.apollo.config', true); +INSERT INTO "AppNamespace" (AppId, Name, IsPublic) VALUES ('100003172', 'application', false); +INSERT INTO "AppNamespace" (AppId, Name, IsPublic) VALUES ('100003172', 'fx.apollo.admin', true); +INSERT INTO "AppNamespace" (AppId, Name, IsPublic) VALUES ('100003173', 'application', false); +INSERT INTO "AppNamespace" (AppId, Name, IsPublic) VALUES ('100003173', 'fx.apollo.portal', true); +INSERT INTO "AppNamespace" (AppID, Name, IsPublic) VALUES ('fxhermesproducer', 'fx.hermes.producer', true); diff --git a/apollo-biz/src/test/resources/import.sql b/apollo-biz/src/test/resources/import.sql index 51c11b6e4c5..709fa2d98d9 100644 --- a/apollo-biz/src/test/resources/import.sql +++ b/apollo-biz/src/test/resources/import.sql @@ -17,9 +17,9 @@ ALTER TABLE APP ALTER COLUMN DataChange_CreatedBy VARCHAR(255) NULL; ALTER TABLE APP ALTER COLUMN DataChange_CreatedTime TIMESTAMP NULL; ALTER TABLE APP ALTER COLUMN ORGNAME VARCHAR(255) NULL; ALTER TABLE APP ALTER COLUMN ORGID VARCHAR(255) NULL; -ALTER TABLE AppNamespace ALTER COLUMN DataChange_CreatedBy VARCHAR(255) NULL; -ALTER TABLE AppNamespace ALTER COLUMN DataChange_CreatedTime TIMESTAMP NULL; -ALTER TABLE AppNamespace ALTER COLUMN Format VARCHAR(255) NULL; +ALTER TABLE "AppNamespace" ALTER COLUMN DataChange_CreatedBy VARCHAR(255) NULL; +ALTER TABLE "AppNamespace" ALTER COLUMN DataChange_CreatedTime TIMESTAMP NULL; +ALTER TABLE "AppNamespace" ALTER COLUMN Format VARCHAR(255) NULL; ALTER TABLE AccessKey ALTER COLUMN DataChange_CreatedBy VARCHAR(255) NULL; ALTER TABLE AccessKey ALTER COLUMN DataChange_CreatedTime TIMESTAMP NULL; ALTER TABLE Instance ALTER COLUMN CLUSTERNAME VARCHAR(255) NULL; @@ -35,17 +35,17 @@ ALTER TABLE Audit ALTER COLUMN DataChange_CreatedTime TIMESTAMP NULL; ALTER TABLE Cluster ALTER COLUMN DataChange_CreatedBy VARCHAR(255) NULL; ALTER TABLE Cluster ALTER COLUMN DataChange_CreatedTime TIMESTAMP NULL; ALTER TABLE Cluster ALTER COLUMN ParentClusterId BIGINT DEFAULT 0; -ALTER TABLE Namespace ALTER COLUMN DataChange_CreatedBy VARCHAR(255) NULL; -ALTER TABLE Namespace ALTER COLUMN DataChange_CreatedTime TIMESTAMP NULL; +ALTER TABLE "Namespace" ALTER COLUMN DataChange_CreatedBy VARCHAR(255) NULL; +ALTER TABLE "Namespace" ALTER COLUMN DataChange_CreatedTime TIMESTAMP NULL; ALTER TABLE Item ALTER COLUMN DataChange_CreatedBy VARCHAR(255) NULL; ALTER TABLE Item ALTER COLUMN DataChange_CreatedTime TIMESTAMP NULL; ALTER TABLE GrayReleaseRule ALTER COLUMN DataChange_CreatedBy VARCHAR(255) NULL; ALTER TABLE GrayReleaseRule ALTER COLUMN DataChange_CreatedTime TIMESTAMP NULL; -ALTER TABLE Release ALTER COLUMN DataChange_CreatedBy VARCHAR(255) NULL; -ALTER TABLE Release ALTER COLUMN DataChange_CreatedTime TIMESTAMP NULL; -ALTER TABLE Release ALTER COLUMN Comment VARCHAR(255) NULL; -ALTER TABLE Release ALTER COLUMN Name VARCHAR(255) NULL; -ALTER TABLE Release ALTER COLUMN ReleaseKey VARCHAR(255) NULL; +ALTER TABLE "Release" ALTER COLUMN DataChange_CreatedBy VARCHAR(255) NULL; +ALTER TABLE "Release" ALTER COLUMN DataChange_CreatedTime TIMESTAMP NULL; +ALTER TABLE "Release" ALTER COLUMN Comment VARCHAR(255) NULL; +ALTER TABLE "Release" ALTER COLUMN Name VARCHAR(255) NULL; +ALTER TABLE "Release" ALTER COLUMN ReleaseKey VARCHAR(255) NULL; ALTER TABLE ReleaseHistory ALTER COLUMN DataChange_CreatedBy VARCHAR(255) NULL; ALTER TABLE ReleaseHistory ALTER COLUMN DataChange_CreatedTime TIMESTAMP NULL; ALTER TABLE Commit ALTER COLUMN DataChange_CreatedBy VARCHAR(255) NULL; diff --git a/apollo-biz/src/test/resources/sql/clean.sql b/apollo-biz/src/test/resources/sql/clean.sql index 57e3344fdc3..5e9778e2972 100644 --- a/apollo-biz/src/test/resources/sql/clean.sql +++ b/apollo-biz/src/test/resources/sql/clean.sql @@ -15,13 +15,13 @@ -- DELETE FROM AccessKey; DELETE FROM App; -DELETE FROM AppNamespace; +DELETE FROM "AppNamespace"; DELETE FROM Cluster; -DELETE FROM namespace; +DELETE FROM "Namespace"; DELETE FROM grayreleaserule; -DELETE FROM release; +DELETE FROM "Release"; DELETE FROM item; -DELETE FROM releasemessage; +DELETE FROM "ReleaseMessage"; DELETE FROM releasehistory; DELETE FROM namespacelock; DELETE FROM `commit`; diff --git a/apollo-biz/src/test/resources/sql/namespace-branch-test.sql b/apollo-biz/src/test/resources/sql/namespace-branch-test.sql index 65860f8cd1d..267389b7dfe 100644 --- a/apollo-biz/src/test/resources/sql/namespace-branch-test.sql +++ b/apollo-biz/src/test/resources/sql/namespace-branch-test.sql @@ -17,7 +17,7 @@ INSERT INTO `app` ( `AppId`, `Name`, `OrgId`, `OrgName`, `OwnerName`, `OwnerEmai INSERT INTO `cluster` (`ID`, `Name`, `AppId`, `ParentClusterId`, `IsDeleted`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`) VALUES (1, 'default', 'test', 0, 0, 'default', 'default'); INSERT INTO `cluster` (`Name`, `AppId`, `ParentClusterId`, `IsDeleted`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`)VALUES('child-cluster', 'test', 1, 0, 'default', 'default'); -INSERT INTO `namespace` (`AppId`, `ClusterName`, `NamespaceName`, `IsDeleted`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`)VALUES('test', 'default', 'application', 0, 'apollo', 'apollo'); -INSERT INTO `namespace` (`AppId`, `ClusterName`, `NamespaceName`, `IsDeleted`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`)VALUES('test', 'child-cluster', 'application', 0, 'apollo', 'apollo'); +INSERT INTO "Namespace" (`AppId`, `ClusterName`, `NamespaceName`, `IsDeleted`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`)VALUES('test', 'default', 'application', 0, 'apollo', 'apollo'); +INSERT INTO "Namespace" (`AppId`, `ClusterName`, `NamespaceName`, `IsDeleted`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`)VALUES('test', 'child-cluster', 'application', 0, 'apollo', 'apollo'); diff --git a/apollo-biz/src/test/resources/sql/namespace-test.sql b/apollo-biz/src/test/resources/sql/namespace-test.sql index 57f72b350b0..df7c5835785 100644 --- a/apollo-biz/src/test/resources/sql/namespace-test.sql +++ b/apollo-biz/src/test/resources/sql/namespace-test.sql @@ -18,10 +18,10 @@ INSERT INTO `app` ( `AppId`, `Name`, `OrgId`, `OrgName`, `OwnerName`, `OwnerEmai INSERT INTO `cluster` (`ID`, `Name`, `AppId`, `ParentClusterId`, `IsDeleted`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`) VALUES (1, 'default', 'testApp', 0, 0, 'default', 'default'); INSERT INTO `cluster` (`Name`, `AppId`, `ParentClusterId`, `IsDeleted`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`)VALUES('child-cluster', 'testApp', 1, 0, 'default', 'default'); -INSERT INTO `appnamespace` (`Name`, `AppId`, `Format`, `IsPublic`) VALUES ( 'application', 'testApp', 'properties', 0); +INSERT INTO "AppNamespace" (`Name`, `AppId`, `Format`, `IsPublic`) VALUES ( 'application', 'testApp', 'properties', 0); -INSERT INTO `namespace` (`ID`, `AppId`, `ClusterName`, `NamespaceName`, `IsDeleted`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`)VALUES(1,'testApp', 'default', 'application', 0, 'apollo', 'apollo'); -INSERT INTO `namespace` (`AppId`, `ClusterName`, `NamespaceName`, `IsDeleted`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`)VALUES('testApp', 'child-cluster', 'application', 0, 'apollo', 'apollo'); +INSERT INTO "Namespace" (`ID`, `AppId`, `ClusterName`, `NamespaceName`, `IsDeleted`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`)VALUES(1,'testApp', 'default', 'application', 0, 'apollo', 'apollo'); +INSERT INTO "Namespace" (`AppId`, `ClusterName`, `NamespaceName`, `IsDeleted`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`)VALUES('testApp', 'child-cluster', 'application', 0, 'apollo', 'apollo'); INSERT INTO `commit` (`ChangeSets`, `AppId`, `ClusterName`, `NamespaceName`)VALUES('{}', 'testApp', 'default', 'application'); INSERT INTO `commit` (`ChangeSets`, `AppId`, `ClusterName`, `NamespaceName`, `DataChange_LastTime`)VALUES('{}', 'commitTestApp', 'default', 'application', '2020-08-22 10:00:00'); @@ -30,8 +30,8 @@ INSERT INTO `item` (`NamespaceId`, "Key", "Value", `Comment`, `LineNum`)VALUES(1 INSERT INTO `namespacelock` (`NamespaceId`)VALUES(1); -INSERT INTO `release` (`AppId`, `ClusterName`, `NamespaceName`, `Configurations`, `IsAbandoned`)VALUES('branch-test', 'default', 'application', '{}', 0); -INSERT INTO `release` (`AppId`, `ClusterName`, `NamespaceName`, `Configurations`, `IsAbandoned`)VALUES('branch-test', 'child-cluster', 'application', '{}', 0); +INSERT INTO "Release" (`AppId`, `ClusterName`, `NamespaceName`, `Configurations`, `IsAbandoned`)VALUES('branch-test', 'default', 'application', '{}', 0); +INSERT INTO "Release" (`AppId`, `ClusterName`, `NamespaceName`, `Configurations`, `IsAbandoned`)VALUES('branch-test', 'child-cluster', 'application', '{}', 0); INSERT INTO `releasehistory` (`AppId`, `ClusterName`, `NamespaceName`, `BranchName`, `ReleaseId`, `PreviousReleaseId`, `Operation`, `OperationContext`)VALUES('branch-test', 'default', 'application', 'default', 0, 0, 7, '{}'); diff --git a/apollo-biz/src/test/resources/sql/release-creation-test.sql b/apollo-biz/src/test/resources/sql/release-creation-test.sql index cf0af951dea..c913a658863 100644 --- a/apollo-biz/src/test/resources/sql/release-creation-test.sql +++ b/apollo-biz/src/test/resources/sql/release-creation-test.sql @@ -17,7 +17,7 @@ INSERT INTO `app` ( `AppId`, `Name`, `OrgId`, `OrgName`, `OwnerName`, `OwnerEmai /* normal namespace*/ INSERT INTO `cluster` ( `Name`, `AppId`, `ParentClusterId`, `IsDeleted`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`) VALUES ( 'only-master', 'test', 0, 0, 'default', 'default'); -INSERT INTO `namespace` (ID, `AppId`, `ClusterName`, `NamespaceName`, `IsDeleted`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`)VALUES(100, 'test', 'only-master', 'application', 0, 'apollo', 'apollo'); +INSERT INTO "Namespace" (ID, `AppId`, `ClusterName`, `NamespaceName`, `IsDeleted`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`)VALUES(100, 'test', 'only-master', 'application', 0, 'apollo', 'apollo'); INSERT INTO `item` (`NamespaceId`, "Key", "Type", "Value", `Comment`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`)VALUES(100, 'k1', '0', 'v1', '', 'apollo', 'apollo'); INSERT INTO `item` (`NamespaceId`, "Key", "Type", "Value", `Comment`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`)VALUES(100, 'k2', '0', 'v2', '', 'apollo', 'apollo'); INSERT INTO `item` (`NamespaceId`, "Key", "Type", "Value", `Comment`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`)VALUES(100, 'k3', '0', 'v3', '', 'apollo', 'apollo'); @@ -27,8 +27,8 @@ INSERT INTO `item` (`NamespaceId`, "Key", "Type", "Value", `Comment`, `DataChang INSERT INTO `cluster` (ID, `Name`, `AppId`, `ParentClusterId`, `IsDeleted`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`) VALUES (101, 'default1', 'test', 0, 0, 'default', 'default'); INSERT INTO `cluster` (ID, `Name`, `AppId`, `ParentClusterId`, `IsDeleted`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`)VALUES(102, 'child-cluster1', 'test', 101, 0, 'default', 'default'); -INSERT INTO `namespace` (ID, `AppId`, `ClusterName`, `NamespaceName`, `IsDeleted`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`)VALUES(101, 'test', 'default1', 'application', 0, 'apollo', 'apollo'); -INSERT INTO `namespace` (ID, `AppId`, `ClusterName`, `NamespaceName`, `IsDeleted`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`)VALUES(102, 'test', 'child-cluster1', 'application', 0, 'apollo', 'apollo'); +INSERT INTO "Namespace" (ID, `AppId`, `ClusterName`, `NamespaceName`, `IsDeleted`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`)VALUES(101, 'test', 'default1', 'application', 0, 'apollo', 'apollo'); +INSERT INTO "Namespace" (ID, `AppId`, `ClusterName`, `NamespaceName`, `IsDeleted`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`)VALUES(102, 'test', 'child-cluster1', 'application', 0, 'apollo', 'apollo'); INSERT INTO `item` (`NamespaceId`, "Key", "Type", "Value", `Comment`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`)VALUES(101, 'k1', '0', 'v1', '', 'apollo', 'apollo'); INSERT INTO `item` (`NamespaceId`, "Key", "Type", "Value", `Comment`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`)VALUES(101, 'k2', '0', 'v2', '', 'apollo', 'apollo'); @@ -42,8 +42,8 @@ INSERT INTO `grayreleaserule` (`AppId`, `ClusterName`, `NamespaceName`, `BranchN INSERT INTO `cluster` (ID, `Name`, `AppId`, `ParentClusterId`, `IsDeleted`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`) VALUES (103, 'default2', 'test', 0, 0, 'default', 'default'); INSERT INTO `cluster` (ID, `Name`, `AppId`, `ParentClusterId`, `IsDeleted`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`)VALUES(104, 'child-cluster2', 'test', 103, 0, 'default', 'default'); -INSERT INTO `namespace` (ID, `AppId`, `ClusterName`, `NamespaceName`, `IsDeleted`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`)VALUES(103, 'test', 'default2', 'application', 0, 'apollo', 'apollo'); -INSERT INTO `namespace` (ID, `AppId`, `ClusterName`, `NamespaceName`, `IsDeleted`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`)VALUES(104, 'test', 'child-cluster2', 'application', 0, 'apollo', 'apollo'); +INSERT INTO "Namespace" (ID, `AppId`, `ClusterName`, `NamespaceName`, `IsDeleted`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`)VALUES(103, 'test', 'default2', 'application', 0, 'apollo', 'apollo'); +INSERT INTO "Namespace" (ID, `AppId`, `ClusterName`, `NamespaceName`, `IsDeleted`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`)VALUES(104, 'test', 'child-cluster2', 'application', 0, 'apollo', 'apollo'); INSERT INTO `item` (`NamespaceId`, "Key", "Type", "Value", `Comment`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`)VALUES(103, 'k1', '0', 'v1', '', 'apollo', 'apollo'); INSERT INTO `item` (`NamespaceId`, "Key", "Type", "Value", `Comment`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`)VALUES(103, 'k2', '0', 'v2', '', 'apollo', 'apollo'); @@ -56,15 +56,15 @@ INSERT INTO `grayreleaserule` (`AppId`, `ClusterName`, `NamespaceName`, `BranchN INSERT INTO `cluster` (ID, `Name`, `AppId`, `ParentClusterId`, `IsDeleted`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`) VALUES (105, 'default3', 'test', 0, 0, 'default', 'default'); INSERT INTO `cluster` (ID, `Name`, `AppId`, `ParentClusterId`, `IsDeleted`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`)VALUES(106, 'child-cluster3', 'test', 105, 0, 'default', 'default'); -INSERT INTO `namespace` (ID, `AppId`, `ClusterName`, `NamespaceName`, `IsDeleted`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`)VALUES(105, 'test', 'default3', 'application', 0, 'apollo', 'apollo'); -INSERT INTO `namespace` (ID, `AppId`, `ClusterName`, `NamespaceName`, `IsDeleted`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`)VALUES(106, 'test', 'child-cluster3', 'application', 0, 'apollo', 'apollo'); +INSERT INTO "Namespace" (ID, `AppId`, `ClusterName`, `NamespaceName`, `IsDeleted`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`)VALUES(105, 'test', 'default3', 'application', 0, 'apollo', 'apollo'); +INSERT INTO "Namespace" (ID, `AppId`, `ClusterName`, `NamespaceName`, `IsDeleted`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`)VALUES(106, 'test', 'child-cluster3', 'application', 0, 'apollo', 'apollo'); INSERT INTO `item` (`NamespaceId`, "Key", "Type", "Value", `Comment`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`)VALUES(105, 'k1', '0', 'v1', '', 'apollo', 'apollo'); INSERT INTO `item` (`NamespaceId`, "Key", "Type", "Value", `Comment`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`)VALUES(105, 'k2', '0', 'v2-2', '', 'apollo', 'apollo'); INSERT INTO `item` (`NamespaceId`, "Key", "Type", "Value", `Comment`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`)VALUES(106, 'k1', '0', 'v1-2', '', 'apollo', 'apollo'); -INSERT INTO `release` (`Id`, `ReleaseKey`, `Name`, `Comment`, `AppId`, `ClusterName`, `NamespaceName`, `Configurations`, `IsAbandoned`)VALUES(1, '20160823102253-fc0071ddf9fd3260', '20160823101703-release', '', 'test', 'default3', 'application', '{"k1":"v1","k2":"v2","k3":"v3"}', 0); -INSERT INTO `release` (`Id`, `ReleaseKey`, `Name`, `Comment`, `AppId`, `ClusterName`, `NamespaceName`, `Configurations`, `IsAbandoned`)VALUES(2, '20160823102253-fc0071ddf9fd3260', '20160823101703-release', '', 'test', 'child-cluster3', 'application', '{"k1":"v1-1","k2":"v2","k3":"v3"}', 0); +INSERT INTO "Release" (`Id`, `ReleaseKey`, `Name`, `Comment`, `AppId`, `ClusterName`, `NamespaceName`, `Configurations`, `IsAbandoned`)VALUES(1, '20160823102253-fc0071ddf9fd3260', '20160823101703-release', '', 'test', 'default3', 'application', '{"k1":"v1","k2":"v2","k3":"v3"}', 0); +INSERT INTO "Release" (`Id`, `ReleaseKey`, `Name`, `Comment`, `AppId`, `ClusterName`, `NamespaceName`, `Configurations`, `IsAbandoned`)VALUES(2, '20160823102253-fc0071ddf9fd3260', '20160823101703-release', '', 'test', 'child-cluster3', 'application', '{"k1":"v1-1","k2":"v2","k3":"v3"}', 0); INSERT INTO `grayreleaserule` (`AppId`, `ClusterName`, `NamespaceName`, `BranchName`, `Rules`, `ReleaseId`, `BranchStatus`)VALUES ('test', 'default3', 'application', 'child-cluster3', '[]', 1155, 1); @@ -72,15 +72,15 @@ INSERT INTO `grayreleaserule` (`AppId`, `ClusterName`, `NamespaceName`, `BranchN INSERT INTO `cluster` (ID, `Name`, `AppId`, `ParentClusterId`, `IsDeleted`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`) VALUES (107, 'default4', 'test', 0, 0, 'default', 'default'); INSERT INTO `cluster` (ID, `Name`, `AppId`, `ParentClusterId`, `IsDeleted`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`)VALUES(108, 'child-cluster4', 'test', 107, 0, 'default', 'default'); -INSERT INTO `namespace` (ID, `AppId`, `ClusterName`, `NamespaceName`, `IsDeleted`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`)VALUES(107, 'test', 'default4', 'application', 0, 'apollo', 'apollo'); -INSERT INTO `namespace` (ID, `AppId`, `ClusterName`, `NamespaceName`, `IsDeleted`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`)VALUES(108, 'test', 'child-cluster4', 'application', 0, 'apollo', 'apollo'); +INSERT INTO "Namespace" (ID, `AppId`, `ClusterName`, `NamespaceName`, `IsDeleted`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`)VALUES(107, 'test', 'default4', 'application', 0, 'apollo', 'apollo'); +INSERT INTO "Namespace" (ID, `AppId`, `ClusterName`, `NamespaceName`, `IsDeleted`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`)VALUES(108, 'test', 'child-cluster4', 'application', 0, 'apollo', 'apollo'); INSERT INTO `item` (`NamespaceId`, "Key", "Type", "Value", `Comment`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`)VALUES(107, 'k1', '0', 'v1', '', 'apollo', 'apollo'); INSERT INTO `item` (`NamespaceId`, "Key", "Type", "Value", `Comment`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`)VALUES(107, 'k2', '0', 'v2-2', '', 'apollo', 'apollo'); INSERT INTO `item` (`NamespaceId`, "Key", "Type", "Value", `Comment`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`)VALUES(108, 'k1', '0', 'v1-2', '', 'apollo', 'apollo'); INSERT INTO `item` (`NamespaceId`, "Key", "Type", "Value", `Comment`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`)VALUES(108, 'k4', '0', 'v4', '', 'apollo', 'apollo'); -INSERT INTO `release` (`Id`, `ReleaseKey`, `Name`, `Comment`, `AppId`, `ClusterName`, `NamespaceName`, `Configurations`, `IsAbandoned`)VALUES(3, '20160823102253-fc0071ddf9fd3260', '20160823101703-release', '', 'test', 'default4', 'application', '{"k1":"v1","k2":"v2","k3":"v3"}', 0); +INSERT INTO "Release" (`Id`, `ReleaseKey`, `Name`, `Comment`, `AppId`, `ClusterName`, `NamespaceName`, `Configurations`, `IsAbandoned`)VALUES(3, '20160823102253-fc0071ddf9fd3260', '20160823101703-release', '', 'test', 'default4', 'application', '{"k1":"v1","k2":"v2","k3":"v3"}', 0); INSERT INTO `grayreleaserule` (`AppId`, `ClusterName`, `NamespaceName`, `BranchName`, `Rules`, `ReleaseId`, `BranchStatus`)VALUES ('test', 'default4', 'application', 'child-cluster4', '[]', 1155, 1); @@ -88,8 +88,8 @@ INSERT INTO `grayreleaserule` (`AppId`, `ClusterName`, `NamespaceName`, `BranchN INSERT INTO `cluster` (ID, `Name`, `AppId`, `ParentClusterId`, `IsDeleted`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`) VALUES (109, 'default5', 'test', 0, 0, 'default', 'default'); INSERT INTO `cluster` (ID, `Name`, `AppId`, `ParentClusterId`, `IsDeleted`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`)VALUES(1010, 'child-cluster5', 'test', 109, 0, 'default', 'default'); -INSERT INTO `namespace` (ID, `AppId`, `ClusterName`, `NamespaceName`, `IsDeleted`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`)VALUES(109, 'test', 'default5', 'application', 0, 'apollo', 'apollo'); -INSERT INTO `namespace` (ID, `AppId`, `ClusterName`, `NamespaceName`, `IsDeleted`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`)VALUES(1010, 'test', 'child-cluster5', 'application', 0, 'apollo', 'apollo'); +INSERT INTO "Namespace" (ID, `AppId`, `ClusterName`, `NamespaceName`, `IsDeleted`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`)VALUES(109, 'test', 'default5', 'application', 0, 'apollo', 'apollo'); +INSERT INTO "Namespace" (ID, `AppId`, `ClusterName`, `NamespaceName`, `IsDeleted`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`)VALUES(1010, 'test', 'child-cluster5', 'application', 0, 'apollo', 'apollo'); INSERT INTO `item` (`NamespaceId`, "Key", "Type", "Value", `Comment`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`)VALUES(109, 'k1', '0', 'v1', '', 'apollo', 'apollo'); INSERT INTO `item` (`NamespaceId`, "Key", "Type", "Value", `Comment`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`)VALUES(109, 'k2', '0', 'v2-2', '', 'apollo', 'apollo'); @@ -97,8 +97,8 @@ INSERT INTO `item` (`NamespaceId`, "Key", "Type", "Value", `Comment`, `DataChang INSERT INTO `item` (`NamespaceId`, "Key", "Type", "Value", `Comment`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`)VALUES(1010, 'k4', '0', 'v4', '', 'apollo', 'apollo'); INSERT INTO `item` (`NamespaceId`, "Key", "Type", "Value", `Comment`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`)VALUES(1010, 'k6', '0', 'v6', '', 'apollo', 'apollo'); -INSERT INTO `release` (`Id`, `ReleaseKey`, `Name`, `Comment`, `AppId`, `ClusterName`, `NamespaceName`, `Configurations`, `IsAbandoned`)VALUES(4, '20160823102253-fc0071ddf9fd3260', '20160823101703-release', '', 'test', 'default5', 'application', '{"k1":"v1","k2":"v2","k3":"v3"}', 0); -INSERT INTO `release` (`Id`, `ReleaseKey`, `Name`, `Comment`, `AppId`, `ClusterName`, `NamespaceName`, `Configurations`, `IsAbandoned`)VALUES(5, '20160823102253-fc0071ddf9fd3260', '20160823101703-release', '', 'test', 'child-cluster5', 'application', '{"k1":"v1-1","k2":"v2","k3":"v3","k4":"v4","k5":"v5"}', 0); +INSERT INTO "Release" (`Id`, `ReleaseKey`, `Name`, `Comment`, `AppId`, `ClusterName`, `NamespaceName`, `Configurations`, `IsAbandoned`)VALUES(4, '20160823102253-fc0071ddf9fd3260', '20160823101703-release', '', 'test', 'default5', 'application', '{"k1":"v1","k2":"v2","k3":"v3"}', 0); +INSERT INTO "Release" (`Id`, `ReleaseKey`, `Name`, `Comment`, `AppId`, `ClusterName`, `NamespaceName`, `Configurations`, `IsAbandoned`)VALUES(5, '20160823102253-fc0071ddf9fd3260', '20160823101703-release', '', 'test', 'child-cluster5', 'application', '{"k1":"v1-1","k2":"v2","k3":"v3","k4":"v4","k5":"v5"}', 0); INSERT INTO `grayreleaserule` (`AppId`, `ClusterName`, `NamespaceName`, `BranchName`, `Rules`, `ReleaseId`, `BranchStatus`)VALUES ('test', 'default5', 'application', 'child-cluster5', '[]', 1155, 1); @@ -106,9 +106,9 @@ INSERT INTO `grayreleaserule` (`AppId`, `ClusterName`, `NamespaceName`, `BranchN INSERT INTO `cluster` (ID, `Name`, `AppId`, `ParentClusterId`, `IsDeleted`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`) VALUES (1011, 'default6', 'test', 0, 0, 'default', 'default'); INSERT INTO `cluster` (ID, `Name`, `AppId`, `ParentClusterId`, `IsDeleted`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`)VALUES(1012, 'child-cluster6', 'test', 1011, 0, 'default', 'default'); -INSERT INTO `namespace` (ID, `AppId`, `ClusterName`, `NamespaceName`, `IsDeleted`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`)VALUES(1011, 'test', 'default6', 'application', 0, 'apollo', 'apollo'); -INSERT INTO `namespace` (ID, `AppId`, `ClusterName`, `NamespaceName`, `IsDeleted`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`)VALUES(1012, 'test', 'child-cluster6', 'application', 0, 'apollo', 'apollo'); +INSERT INTO "Namespace" (ID, `AppId`, `ClusterName`, `NamespaceName`, `IsDeleted`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`)VALUES(1011, 'test', 'default6', 'application', 0, 'apollo', 'apollo'); +INSERT INTO "Namespace" (ID, `AppId`, `ClusterName`, `NamespaceName`, `IsDeleted`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`)VALUES(1012, 'test', 'child-cluster6', 'application', 0, 'apollo', 'apollo'); -INSERT INTO `release` (`Id`, `ReleaseKey`, `Name`, `Comment`, `AppId`, `ClusterName`, `NamespaceName`, `Configurations`, `IsAbandoned`)VALUES(6, '20160823102253-fc0071ddf9fd3260', '20160823101703-release', '', 'test', 'default6', 'application', '{"k1":"v1-1","k2":"v2-1","k3":"v3"}', 0); -INSERT INTO `release` (`Id`, `ReleaseKey`, `Name`, `Comment`, `AppId`, `ClusterName`, `NamespaceName`, `Configurations`, `IsAbandoned`)VALUES(7, '20160823102253-fc0071ddf9fd3260', '20160823101703-release', '', 'test', 'default6', 'application', '{"k1":"v1","k2":"v2"}', 0); -INSERT INTO `release` (`Id`, `ReleaseKey`, `Name`, `Comment`, `AppId`, `ClusterName`, `NamespaceName`, `Configurations`, `IsAbandoned`)VALUES(8, '20160823102253-fc0071ddf9fd3260', '20160823101703-release', '', 'test', 'child-cluster6', 'application', '{"k1":"v1-2","k2":"v2","k3":"v3"}', 0); +INSERT INTO "Release" (`Id`, `ReleaseKey`, `Name`, `Comment`, `AppId`, `ClusterName`, `NamespaceName`, `Configurations`, `IsAbandoned`)VALUES(6, '20160823102253-fc0071ddf9fd3260', '20160823101703-release', '', 'test', 'default6', 'application', '{"k1":"v1-1","k2":"v2-1","k3":"v3"}', 0); +INSERT INTO "Release" (`Id`, `ReleaseKey`, `Name`, `Comment`, `AppId`, `ClusterName`, `NamespaceName`, `Configurations`, `IsAbandoned`)VALUES(7, '20160823102253-fc0071ddf9fd3260', '20160823101703-release', '', 'test', 'default6', 'application', '{"k1":"v1","k2":"v2"}', 0); +INSERT INTO "Release" (`Id`, `ReleaseKey`, `Name`, `Comment`, `AppId`, `ClusterName`, `NamespaceName`, `Configurations`, `IsAbandoned`)VALUES(8, '20160823102253-fc0071ddf9fd3260', '20160823101703-release', '', 'test', 'child-cluster6', 'application', '{"k1":"v1-2","k2":"v2","k3":"v3"}', 0); diff --git a/apollo-common/src/main/java/com/ctrip/framework/apollo/common/entity/AppNamespace.java b/apollo-common/src/main/java/com/ctrip/framework/apollo/common/entity/AppNamespace.java index 085f2e544cf..f6c740cad66 100644 --- a/apollo-common/src/main/java/com/ctrip/framework/apollo/common/entity/AppNamespace.java +++ b/apollo-common/src/main/java/com/ctrip/framework/apollo/common/entity/AppNamespace.java @@ -30,7 +30,7 @@ import javax.persistence.Table; @Entity -@Table(name = "AppNamespace") +@Table(name = "`AppNamespace`") @SQLDelete(sql = "Update AppNamespace set IsDeleted = 1, DeletedAt = ROUND(UNIX_TIMESTAMP(NOW(4))*1000) where Id = ?") @Where(clause = "isDeleted = 0") public class AppNamespace extends BaseEntity { diff --git a/apollo-common/src/main/resources/application.yaml b/apollo-common/src/main/resources/application.yaml index 450f08d992e..ab026b99e5d 100644 --- a/apollo-common/src/main/resources/application.yaml +++ b/apollo-common/src/main/resources/application.yaml @@ -18,9 +18,9 @@ spring: jpa: properties: hibernate: - globally_quoted_identifiers: 'true' + globally_quoted_identifiers: 'false' hibernate: - globally_quoted_identifiers: 'true' + globally_quoted_identifiers: 'false' # Naming strategy naming: physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl diff --git a/apollo-configservice/src/test/resources/data.sql b/apollo-configservice/src/test/resources/data.sql index bc6674f8909..835bf06e091 100644 --- a/apollo-configservice/src/test/resources/data.sql +++ b/apollo-configservice/src/test/resources/data.sql @@ -26,23 +26,23 @@ INSERT INTO Cluster (AppId, Name) VALUES ('100003173', 'default'); INSERT INTO Cluster (AppId, Name) VALUES ('100003173', 'cluster3'); INSERT INTO Cluster (AppId, Name) VALUES ('fxhermesproducer', 'default'); -INSERT INTO AppNamespace (AppId, Name) VALUES ('100003171', 'application'); -INSERT INTO AppNamespace (AppId, Name) VALUES ('100003171', 'fx.apollo.config'); -INSERT INTO AppNamespace (AppId, Name) VALUES ('100003172', 'application'); -INSERT INTO AppNamespace (AppId, Name) VALUES ('100003172', 'fx.apollo.admin'); -INSERT INTO AppNamespace (AppId, Name) VALUES ('100003173', 'application'); -INSERT INTO AppNamespace (AppId, Name) VALUES ('100003173', 'fx.apollo.portal'); -INSERT INTO AppNamespace (AppID, Name) VALUES ('fxhermesproducer', 'fx.hermes.producer'); +INSERT INTO "AppNamespace" (AppId, Name) VALUES ('100003171', 'application'); +INSERT INTO "AppNamespace" (AppId, Name) VALUES ('100003171', 'fx.apollo.config'); +INSERT INTO "AppNamespace" (AppId, Name) VALUES ('100003172', 'application'); +INSERT INTO "AppNamespace" (AppId, Name) VALUES ('100003172', 'fx.apollo.admin'); +INSERT INTO "AppNamespace" (AppId, Name) VALUES ('100003173', 'application'); +INSERT INTO "AppNamespace" (AppId, Name) VALUES ('100003173', 'fx.apollo.portal'); +INSERT INTO "AppNamespace" (AppID, Name) VALUES ('fxhermesproducer', 'fx.hermes.producer'); -INSERT INTO Namespace (Id, AppId, ClusterName, NamespaceName) VALUES (1, '100003171', 'default', 'application'); -INSERT INTO Namespace (Id, AppId, ClusterName, NamespaceName) VALUES (2, 'fxhermesproducer', 'default', 'fx.hermes.producer'); -INSERT INTO Namespace (Id, AppId, ClusterName, NamespaceName) VALUES (3, '100003172', 'default', 'application'); -INSERT INTO Namespace (Id, AppId, ClusterName, NamespaceName) VALUES (4, '100003173', 'default', 'application'); -INSERT INTO Namespace (Id, AppId, ClusterName, NamespaceName) VALUES (5, '100003171', 'default', 'application'); +INSERT INTO "Namespace" (Id, AppId, ClusterName, NamespaceName) VALUES (1, '100003171', 'default', 'application'); +INSERT INTO "Namespace" (Id, AppId, ClusterName, NamespaceName) VALUES (2, 'fxhermesproducer', 'default', 'fx.hermes.producer'); +INSERT INTO "Namespace" (Id, AppId, ClusterName, NamespaceName) VALUES (3, '100003172', 'default', 'application'); +INSERT INTO "Namespace" (Id, AppId, ClusterName, NamespaceName) VALUES (4, '100003173', 'default', 'application'); +INSERT INTO "Namespace" (Id, AppId, ClusterName, NamespaceName) VALUES (5, '100003171', 'default', 'application'); INSERT INTO Item (NamespaceId, "Key", "Value", Comment) VALUES (1, 'k1', 'v1', 'comment1'); INSERT INTO Item (NamespaceId, "Key", "Value", Comment) VALUES (1, 'k2', 'v2', 'comment2'); INSERT INTO Item (NamespaceId, "Key", "Value", Comment) VALUES (2, 'k3', 'v3', 'comment3'); INSERT INTO Item (NamespaceId, "Key", "Value", Comment) VALUES (5, 'k3', 'v4', 'comment4'); -INSERT INTO RELEASE (ReleaseKey, Name, Comment, AppId, ClusterName, NamespaceName, Configurations) VALUES ('TEST-RELEASE-KEY', 'REV1','First Release','100003171', 'default', 'application', '{"k1":"v1"}'); +INSERT INTO "Release" (ReleaseKey, Name, Comment, AppId, ClusterName, NamespaceName, Configurations) VALUES ('TEST-RELEASE-KEY', 'REV1','First Release','100003171', 'default', 'application', '{"k1":"v1"}'); diff --git a/apollo-configservice/src/test/resources/import.sql b/apollo-configservice/src/test/resources/import.sql index a238396b7db..3f05e588330 100644 --- a/apollo-configservice/src/test/resources/import.sql +++ b/apollo-configservice/src/test/resources/import.sql @@ -20,12 +20,12 @@ ALTER TABLE APP ALTER COLUMN ORGID VARCHAR(255) NULL; ALTER TABLE Cluster ALTER COLUMN DataChange_CreatedBy VARCHAR(255) NULL; ALTER TABLE Cluster ALTER COLUMN DataChange_CreatedTime TIMESTAMP NULL; ALTER TABLE Cluster ALTER COLUMN ParentClusterId BIGINT DEFAULT 0; -ALTER TABLE Namespace ALTER COLUMN DataChange_CreatedBy VARCHAR(255) NULL; -ALTER TABLE Namespace ALTER COLUMN DataChange_CreatedTime TIMESTAMP NULL; +ALTER TABLE "Namespace" ALTER COLUMN DataChange_CreatedBy VARCHAR(255) NULL; +ALTER TABLE "Namespace" ALTER COLUMN DataChange_CreatedTime TIMESTAMP NULL; ALTER TABLE Item ALTER COLUMN DataChange_CreatedBy VARCHAR(255) NULL; ALTER TABLE Item ALTER COLUMN DataChange_CreatedTime TIMESTAMP NULL; -ALTER TABLE RELEASE ALTER COLUMN DataChange_CreatedBy VARCHAR(255) NULL; -ALTER TABLE RELEASE ALTER COLUMN DataChange_CreatedTime TIMESTAMP NULL; +ALTER TABLE "Release" ALTER COLUMN DataChange_CreatedBy VARCHAR(255) NULL; +ALTER TABLE "Release" ALTER COLUMN DataChange_CreatedTime TIMESTAMP NULL; ALTER TABLE ServerConfig ALTER COLUMN DataChange_CreatedBy VARCHAR(255) NULL; ALTER TABLE ServerConfig ALTER COLUMN DataChange_CreatedTime TIMESTAMP NULL; ALTER TABLE ServerConfig ALTER COLUMN COMMENT VARCHAR(255) NULL; @@ -33,13 +33,13 @@ ALTER TABLE Audit ALTER COLUMN DataChange_CreatedBy VARCHAR(255) NULL; ALTER TABLE Audit ALTER COLUMN DataChange_CreatedTime TIMESTAMP NULL; ALTER TABLE GrayReleaseRule ALTER COLUMN DataChange_CreatedBy VARCHAR(255) NULL; ALTER TABLE GrayReleaseRule ALTER COLUMN DataChange_CreatedTime TIMESTAMP NULL; -ALTER TABLE RELEASE ALTER COLUMN DataChange_CreatedBy VARCHAR(255) NULL; -ALTER TABLE RELEASE ALTER COLUMN DataChange_CreatedTime TIMESTAMP NULL; +ALTER TABLE "Release" ALTER COLUMN DataChange_CreatedBy VARCHAR(255) NULL; +ALTER TABLE "Release" ALTER COLUMN DataChange_CreatedTime TIMESTAMP NULL; ALTER TABLE Item ALTER COLUMN DataChange_CreatedBy VARCHAR(255) NULL; ALTER TABLE Item ALTER COLUMN DataChange_CreatedTime TIMESTAMP NULL; -ALTER TABLE Namespace ALTER COLUMN DataChange_CreatedBy VARCHAR(255) NULL; -ALTER TABLE Namespace ALTER COLUMN DataChange_CreatedTime TIMESTAMP NULL; -ALTER TABLE AppNamespace ALTER COLUMN DataChange_CreatedBy VARCHAR(255) NULL; -ALTER TABLE AppNamespace ALTER COLUMN DataChange_CreatedTime TIMESTAMP NULL; -ALTER TABLE AppNamespace ALTER COLUMN Format VARCHAR(255) NULL; +ALTER TABLE "Namespace" ALTER COLUMN DataChange_CreatedBy VARCHAR(255) NULL; +ALTER TABLE "Namespace" ALTER COLUMN DataChange_CreatedTime TIMESTAMP NULL; +ALTER TABLE "AppNamespace" ALTER COLUMN DataChange_CreatedBy VARCHAR(255) NULL; +ALTER TABLE "AppNamespace" ALTER COLUMN DataChange_CreatedTime TIMESTAMP NULL; +ALTER TABLE "AppNamespace" ALTER COLUMN Format VARCHAR(255) NULL; CREATE ALIAS IF NOT EXISTS UNIX_TIMESTAMP FOR "com.ctrip.framework.apollo.common.jpa.H2Function.unixTimestamp"; diff --git a/apollo-configservice/src/test/resources/integration-test/cleanup.sql b/apollo-configservice/src/test/resources/integration-test/cleanup.sql index 824b0ffdd4e..87a16625bd6 100644 --- a/apollo-configservice/src/test/resources/integration-test/cleanup.sql +++ b/apollo-configservice/src/test/resources/integration-test/cleanup.sql @@ -13,12 +13,12 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- -DELETE FROM Release; -DELETE FROM Namespace; -DELETE FROM AppNamespace; +DELETE FROM "Release"; +DELETE FROM "Namespace"; +DELETE FROM "AppNamespace"; DELETE FROM Cluster; DELETE FROM App; -DELETE FROM ReleaseMessage; +DELETE FROM "ReleaseMessage"; DELETE FROM GrayReleaseRule; diff --git a/apollo-configservice/src/test/resources/integration-test/test-release-message.sql b/apollo-configservice/src/test/resources/integration-test/test-release-message.sql index fd624df1012..dd0e782949a 100644 --- a/apollo-configservice/src/test/resources/integration-test/test-release-message.sql +++ b/apollo-configservice/src/test/resources/integration-test/test-release-message.sql @@ -13,9 +13,9 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- -INSERT INTO `releasemessage` (`Id`, `Message`) +INSERT INTO "ReleaseMessage" (`Id`, `Message`) VALUES (10, 'someAppId+default+application'); -INSERT INTO `releasemessage` (`Id`, `Message`) +INSERT INTO "ReleaseMessage" (`Id`, `Message`) VALUES (20, 'somePublicAppId+default+somePublicNamespace'); diff --git a/apollo-configservice/src/test/resources/integration-test/test-release-public-dc-override.sql b/apollo-configservice/src/test/resources/integration-test/test-release-public-dc-override.sql index 57a87dc28f5..f39fdb55a90 100644 --- a/apollo-configservice/src/test/resources/integration-test/test-release-public-dc-override.sql +++ b/apollo-configservice/src/test/resources/integration-test/test-release-public-dc-override.sql @@ -13,5 +13,5 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- -INSERT INTO RELEASE (id, ReleaseKey, Name, Comment, AppId, ClusterName, NamespaceName, Configurations) +INSERT INTO "Release" (id, ReleaseKey, Name, Comment, AppId, ClusterName, NamespaceName, Configurations) VALUES (995, 'TEST-RELEASE-KEY6', 'INTEGRATION-TEST-DEFAULT-OVERRIDE-PUBLIC-DC','First Release','someAppId', 'someDC', 'somePublicNamespace', '{"k1":"override-someDC-v1"}'); diff --git a/apollo-configservice/src/test/resources/integration-test/test-release-public-default-override.sql b/apollo-configservice/src/test/resources/integration-test/test-release-public-default-override.sql index 28302ac6f69..86d95cb1c93 100644 --- a/apollo-configservice/src/test/resources/integration-test/test-release-public-default-override.sql +++ b/apollo-configservice/src/test/resources/integration-test/test-release-public-default-override.sql @@ -13,5 +13,5 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- -INSERT INTO RELEASE (id, ReleaseKey, Name, Comment, AppId, ClusterName, NamespaceName, Configurations) +INSERT INTO "Release" (id, ReleaseKey, Name, Comment, AppId, ClusterName, NamespaceName, Configurations) VALUES (994, 'TEST-RELEASE-KEY5', 'INTEGRATION-TEST-DEFAULT-OVERRIDE-PUBLIC','First Release','someAppId', 'default', 'somePublicNamespace', '{"k1":"override-v1"}'); diff --git a/apollo-configservice/src/test/resources/integration-test/test-release.sql b/apollo-configservice/src/test/resources/integration-test/test-release.sql index 4b67043027f..40b212c7e36 100644 --- a/apollo-configservice/src/test/resources/integration-test/test-release.sql +++ b/apollo-configservice/src/test/resources/integration-test/test-release.sql @@ -21,38 +21,38 @@ INSERT INTO Cluster (AppId, Name) VALUES ('someAppId', 'someCluster'); INSERT INTO Cluster (AppId, Name) VALUES ('somePublicAppId', 'default'); INSERT INTO Cluster (AppId, Name) VALUES ('somePublicAppId', 'someDC'); -INSERT INTO AppNamespace (AppId, Name, IsPublic) VALUES ('someAppId', 'application', false); -INSERT INTO AppNamespace (AppId, Name, IsPublic) VALUES ('someAppId', 'someNamespace', true); -INSERT INTO AppNamespace (AppId, Name, IsPublic) VALUES ('someAppId', 'someNamespace.xml', false); -INSERT INTO AppNamespace (AppId, Name, IsPublic) VALUES ('someAppId', 'anotherNamespace', false); -INSERT INTO AppNamespace (AppId, Name, IsPublic) VALUES ('somePublicAppId', 'application', false); -INSERT INTO AppNamespace (AppId, Name, IsPublic) VALUES ('somePublicAppId', 'somePublicNamespace', true); -INSERT INTO AppNamespace (AppId, Name, IsPublic) VALUES ('somePublicAppId', 'anotherNamespace', true); +INSERT INTO "AppNamespace" (AppId, Name, IsPublic) VALUES ('someAppId', 'application', false); +INSERT INTO "AppNamespace" (AppId, Name, IsPublic) VALUES ('someAppId', 'someNamespace', true); +INSERT INTO "AppNamespace" (AppId, Name, IsPublic) VALUES ('someAppId', 'someNamespace.xml', false); +INSERT INTO "AppNamespace" (AppId, Name, IsPublic) VALUES ('someAppId', 'anotherNamespace', false); +INSERT INTO "AppNamespace" (AppId, Name, IsPublic) VALUES ('somePublicAppId', 'application', false); +INSERT INTO "AppNamespace" (AppId, Name, IsPublic) VALUES ('somePublicAppId', 'somePublicNamespace', true); +INSERT INTO "AppNamespace" (AppId, Name, IsPublic) VALUES ('somePublicAppId', 'anotherNamespace', true); -INSERT INTO Namespace (AppId, ClusterName, NamespaceName) VALUES ('someAppId', 'default', 'application'); -INSERT INTO Namespace (AppId, ClusterName, NamespaceName) VALUES ('someAppId', 'default', 'someNamespace.xml'); -INSERT INTO Namespace (AppId, ClusterName, NamespaceName) VALUES ('someAppId', 'default', 'anotherNamespace'); -INSERT INTO Namespace (AppId, ClusterName, NamespaceName) VALUES ('someAppId', 'someCluster', 'someNamespace'); -INSERT INTO Namespace (AppId, ClusterName, NamespaceName) VALUES ('somePublicAppId', 'default', 'application'); -INSERT INTO Namespace (AppId, ClusterName, NamespaceName) VALUES ('somePublicAppId', 'someDC', 'somePublicNamespace'); -INSERT INTO Namespace (AppId, ClusterName, NamespaceName) VALUES ('someAppId', 'default', 'somePublicNamespace'); -INSERT INTO Namespace (AppId, ClusterName, NamespaceName) VALUES ('somePublicAppId', 'default', 'anotherNamespace'); +INSERT INTO "Namespace" (AppId, ClusterName, NamespaceName) VALUES ('someAppId', 'default', 'application'); +INSERT INTO "Namespace" (AppId, ClusterName, NamespaceName) VALUES ('someAppId', 'default', 'someNamespace.xml'); +INSERT INTO "Namespace" (AppId, ClusterName, NamespaceName) VALUES ('someAppId', 'default', 'anotherNamespace'); +INSERT INTO "Namespace" (AppId, ClusterName, NamespaceName) VALUES ('someAppId', 'someCluster', 'someNamespace'); +INSERT INTO "Namespace" (AppId, ClusterName, NamespaceName) VALUES ('somePublicAppId', 'default', 'application'); +INSERT INTO "Namespace" (AppId, ClusterName, NamespaceName) VALUES ('somePublicAppId', 'someDC', 'somePublicNamespace'); +INSERT INTO "Namespace" (AppId, ClusterName, NamespaceName) VALUES ('someAppId', 'default', 'somePublicNamespace'); +INSERT INTO "Namespace" (AppId, ClusterName, NamespaceName) VALUES ('somePublicAppId', 'default', 'anotherNamespace'); -INSERT INTO RELEASE (id, ReleaseKey, Name, Comment, AppId, ClusterName, NamespaceName, Configurations) +INSERT INTO "Release" (id, ReleaseKey, Name, Comment, AppId, ClusterName, NamespaceName, Configurations) VALUES (990, 'TEST-RELEASE-KEY1', 'INTEGRATION-TEST-DEFAULT','First Release','someAppId', 'default', 'application', '{"k1":"v1"}'); -INSERT INTO RELEASE (id, ReleaseKey, Name, Comment, AppId, ClusterName, NamespaceName, Configurations) +INSERT INTO "Release" (id, ReleaseKey, Name, Comment, AppId, ClusterName, NamespaceName, Configurations) VALUES (991, 'TEST-RELEASE-KEY2', 'INTEGRATION-TEST-NAMESPACE','First Release','someAppId', 'someCluster', 'someNamespace', '{"k2":"v2"}'); -INSERT INTO RELEASE (id, ReleaseKey, Name, Comment, AppId, ClusterName, NamespaceName, Configurations) +INSERT INTO "Release" (id, ReleaseKey, Name, Comment, AppId, ClusterName, NamespaceName, Configurations) VALUES (992, 'TEST-RELEASE-KEY3', 'INTEGRATION-TEST-PUBLIC-DEFAULT','First Release','somePublicAppId', 'default', 'somePublicNamespace', '{"k1":"default-v1", "k2":"default-v2"}'); -INSERT INTO RELEASE (id, ReleaseKey, Name, Comment, AppId, ClusterName, NamespaceName, Configurations) +INSERT INTO "Release" (id, ReleaseKey, Name, Comment, AppId, ClusterName, NamespaceName, Configurations) VALUES (993, 'TEST-RELEASE-KEY4', 'INTEGRATION-TEST-PUBLIC-NAMESPACE','First Release','somePublicAppId', 'someDC', 'somePublicNamespace', '{"k1":"someDC-v1", "k2":"someDC-v2"}'); -INSERT INTO RELEASE (id, ReleaseKey, Name, Comment, AppId, ClusterName, NamespaceName, Configurations) +INSERT INTO "Release" (id, ReleaseKey, Name, Comment, AppId, ClusterName, NamespaceName, Configurations) VALUES (989, 'TEST-RELEASE-KEY5', 'INTEGRATION-TEST-PRIVATE-CONFIG-FILE','First Release','someAppId', 'default', 'someNamespace.xml', '{"k1":"v1-file", "k2":"v2-file"}'); -INSERT INTO RELEASE (id, ReleaseKey, Name, Comment, AppId, ClusterName, NamespaceName, Configurations) +INSERT INTO "Release" (id, ReleaseKey, Name, Comment, AppId, ClusterName, NamespaceName, Configurations) VALUES (988, 'TEST-RELEASE-KEY6', 'INTEGRATION-TEST-PRIVATE-CONFIG-FILE','First Release','someAppId', 'default', 'anotherNamespace', '{"k1":"v1-file"}'); -INSERT INTO RELEASE (id, ReleaseKey, Name, Comment, AppId, ClusterName, NamespaceName, Configurations) +INSERT INTO "Release" (id, ReleaseKey, Name, Comment, AppId, ClusterName, NamespaceName, Configurations) VALUES (987, 'TEST-RELEASE-KEY7', 'INTEGRATION-TEST-PUBLIC-CONFIG-FILE','First Release','somePublicAppId', 'default', 'anotherNamespace', '{"k2":"v2-file"}'); -INSERT INTO RELEASE (id, ReleaseKey, Name, Comment, AppId, ClusterName, NamespaceName, Configurations) +INSERT INTO "Release" (id, ReleaseKey, Name, Comment, AppId, ClusterName, NamespaceName, Configurations) VALUES (986, 'TEST-GRAY-RELEASE-KEY1', 'INTEGRATION-TEST-DEFAULT','Gray Release','someAppId', 'gray-branch-1', 'application', '{"k1":"v1-gray"}'); -INSERT INTO RELEASE (id, ReleaseKey, Name, Comment, AppId, ClusterName, NamespaceName, Configurations) +INSERT INTO "Release" (id, ReleaseKey, Name, Comment, AppId, ClusterName, NamespaceName, Configurations) VALUES (985, 'TEST-GRAY-RELEASE-KEY2', 'INTEGRATION-TEST-NAMESPACE','Gray Release','somePublicAppId', 'gray-branch-2', 'somePublicNamespace', '{"k1":"gray-v1", "k2":"gray-v2"}'); \ No newline at end of file diff --git a/apollo-portal/src/test/resources/import.sql b/apollo-portal/src/test/resources/import.sql index 55b95c1f8d9..1e7cfc18088 100644 --- a/apollo-portal/src/test/resources/import.sql +++ b/apollo-portal/src/test/resources/import.sql @@ -27,9 +27,9 @@ ALTER TABLE Permission ALTER COLUMN DataChange_CreatedBy VARCHAR(255) NULL; ALTER TABLE Permission ALTER COLUMN DataChange_CreatedTime TIMESTAMP NULL; ALTER TABLE RolePermission ALTER COLUMN DataChange_CreatedBy VARCHAR(255) NULL; ALTER TABLE RolePermission ALTER COLUMN DataChange_CreatedTime TIMESTAMP NULL; -ALTER TABLE AppNamespace ALTER COLUMN DataChange_CreatedBy VARCHAR(255) NULL; -ALTER TABLE AppNamespace ALTER COLUMN DataChange_CreatedTime TIMESTAMP NULL; -ALTER TABLE AppNamespace ALTER COLUMN Format VARCHAR(255) NULL; +ALTER TABLE "AppNamespace" ALTER COLUMN DataChange_CreatedBy VARCHAR(255) NULL; +ALTER TABLE "AppNamespace" ALTER COLUMN DataChange_CreatedTime TIMESTAMP NULL; +ALTER TABLE "AppNamespace" ALTER COLUMN Format VARCHAR(255) NULL; ALTER TABLE APP ALTER COLUMN DataChange_CreatedTime TIMESTAMP NULL; ALTER TABLE ServerConfig ALTER COLUMN COMMENT VARCHAR(255) NULL; CREATE ALIAS IF NOT EXISTS UNIX_TIMESTAMP FOR "com.ctrip.framework.apollo.common.jpa.H2Function.unixTimestamp"; diff --git a/apollo-portal/src/test/resources/sql/appnamespaceservice/init-appnamespace.sql b/apollo-portal/src/test/resources/sql/appnamespaceservice/init-appnamespace.sql index 205f4926777..84b9b1b9d8d 100644 --- a/apollo-portal/src/test/resources/sql/appnamespaceservice/init-appnamespace.sql +++ b/apollo-portal/src/test/resources/sql/appnamespaceservice/init-appnamespace.sql @@ -13,7 +13,7 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- -INSERT INTO `appnamespace` (`Id`, `Name`, `AppId`, `Format`, `IsPublic`, `Comment`, `IsDeleted`, `DataChange_CreatedBy`, `DataChange_CreatedTime`, `DataChange_LastModifiedBy`, `DataChange_LastTime`) +INSERT INTO "AppNamespace" (`Id`, `Name`, `AppId`, `Format`, `IsPublic`, `Comment`, `IsDeleted`, `DataChange_CreatedBy`, `DataChange_CreatedTime`, `DataChange_LastModifiedBy`, `DataChange_LastTime`) VALUES (139, 'FX.old', '100003173', 'properties', 1, '', 0, 'zhanglea', '2016-07-11 10:00:58', 'zhanglea', '2016-07-11 10:00:58'), (140, 'SCC.song0711-03', 'song0711-01', 'properties', 1, '', 0, 'song_s', '2016-07-11 10:04:09', 'song_s', '2016-07-11 10:04:09'), diff --git a/apollo-portal/src/test/resources/sql/cleanup.sql b/apollo-portal/src/test/resources/sql/cleanup.sql index b7f429dafe5..8ceef06ae13 100644 --- a/apollo-portal/src/test/resources/sql/cleanup.sql +++ b/apollo-portal/src/test/resources/sql/cleanup.sql @@ -14,7 +14,7 @@ -- limitations under the License. -- DELETE FROM `App`; -DELETE FROM `AppNamespace`; +DELETE FROM "AppNamespace"; -- DELETE FROM `Authorities`; DELETE FROM `Consumer`; DELETE FROM `ConsumerAudit`; diff --git a/apollo-portal/src/test/resources/sql/openapi/ConsumerServiceIntegrationTest.commonData.sql b/apollo-portal/src/test/resources/sql/openapi/ConsumerServiceIntegrationTest.commonData.sql index ef1fc41c930..440cbf7c6cf 100644 --- a/apollo-portal/src/test/resources/sql/openapi/ConsumerServiceIntegrationTest.commonData.sql +++ b/apollo-portal/src/test/resources/sql/openapi/ConsumerServiceIntegrationTest.commonData.sql @@ -52,11 +52,11 @@ INSERT INTO `App` (`Id`, `AppId`, `Name`, `OrgId`, `OrgName`, `OwnerName`, `Owne /*!40000 ALTER TABLE `App` ENABLE KEYS */; /*!40000 ALTER TABLE `AppNamespace` DISABLE KEYS */; -INSERT INTO `AppNamespace` (`Id`, `Name`, `AppId`, `Format`, `Comment`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`) VALUES +INSERT INTO "AppNamespace" (`Id`, `Name`, `AppId`, `Format`, `Comment`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`) VALUES (1000, 'application', 'consumer-test-app-id-0', 'properties', 'default app namespace', 'apollo', 'apollo'); -INSERT INTO `AppNamespace` (`Id`, `Name`, `AppId`, `Format`, `Comment`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`) VALUES +INSERT INTO "AppNamespace" (`Id`, `Name`, `AppId`, `Format`, `Comment`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`) VALUES (2000, 'application', 'consumer-test-app-id-1', 'properties', 'default app namespace', 'apollo', 'apollo'); -INSERT INTO `AppNamespace` (`Id`, `Name`, `AppId`, `Format`, `Comment`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`) VALUES +INSERT INTO "AppNamespace" (`Id`, `Name`, `AppId`, `Format`, `Comment`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`) VALUES (3000, 'application', 'consumer-test-app-id-2', 'properties', 'default app namespace', 'apollo', 'apollo'); /*!40000 ALTER TABLE `AppNamespace` ENABLE KEYS */; diff --git a/apollo-portal/src/test/resources/sql/openapi/ConsumerServiceIntegrationTest.testFindAppIdsAuthorizedByConsumerId.sql b/apollo-portal/src/test/resources/sql/openapi/ConsumerServiceIntegrationTest.testFindAppIdsAuthorizedByConsumerId.sql index 32cbe796ba0..7fedd52e3a0 100644 --- a/apollo-portal/src/test/resources/sql/openapi/ConsumerServiceIntegrationTest.testFindAppIdsAuthorizedByConsumerId.sql +++ b/apollo-portal/src/test/resources/sql/openapi/ConsumerServiceIntegrationTest.testFindAppIdsAuthorizedByConsumerId.sql @@ -52,11 +52,11 @@ INSERT INTO `App` (`Id`, `AppId`, `Name`, `OrgId`, `OrgName`, `OwnerName`, `Owne /*!40000 ALTER TABLE `App` ENABLE KEYS */; /*!40000 ALTER TABLE `AppNamespace` DISABLE KEYS */; -INSERT INTO `AppNamespace` (`Id`, `Name`, `AppId`, `Format`, `Comment`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`) VALUES +INSERT INTO "AppNamespace" (`Id`, `Name`, `AppId`, `Format`, `Comment`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`) VALUES (1000, 'application', 'consumer-test-app-id-0', 'properties', 'default app namespace', 'apollo', 'apollo'); -INSERT INTO `AppNamespace` (`Id`, `Name`, `AppId`, `Format`, `Comment`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`) VALUES +INSERT INTO "AppNamespace" (`Id`, `Name`, `AppId`, `Format`, `Comment`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`) VALUES (2000, 'application', 'consumer-test-app-id-1', 'properties', 'default app namespace', 'apollo', 'apollo'); -INSERT INTO `AppNamespace` (`Id`, `Name`, `AppId`, `Format`, `Comment`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`) VALUES +INSERT INTO "AppNamespace" (`Id`, `Name`, `AppId`, `Format`, `Comment`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`) VALUES (3000, 'application', 'consumer-test-app-id-2', 'properties', 'default app namespace', 'apollo', 'apollo'); /*!40000 ALTER TABLE `AppNamespace` ENABLE KEYS */; diff --git a/apollo-portal/src/test/resources/sql/openapi/NamespaceControllerTest.testCreateAppNamespace.sql b/apollo-portal/src/test/resources/sql/openapi/NamespaceControllerTest.testCreateAppNamespace.sql index 027cfda1957..60357292fa4 100644 --- a/apollo-portal/src/test/resources/sql/openapi/NamespaceControllerTest.testCreateAppNamespace.sql +++ b/apollo-portal/src/test/resources/sql/openapi/NamespaceControllerTest.testCreateAppNamespace.sql @@ -49,9 +49,9 @@ INSERT INTO `App` (`Id`, `AppId`, `Name`, `OrgId`, `OrgName`, `OwnerName`, `Owne /*!40000 ALTER TABLE `App` ENABLE KEYS */; /*!40000 ALTER TABLE `AppNamespace` DISABLE KEYS */; -INSERT INTO `AppNamespace` (`Id`, `Name`, `AppId`, `Format`, `Comment`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`) VALUES +INSERT INTO "AppNamespace" (`Id`, `Name`, `AppId`, `Format`, `Comment`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`) VALUES (1000, 'application', 'consumer-test-app-id-0', 'properties', 'default app namespace', 'apollo', 'apollo'); -INSERT INTO `AppNamespace` (`Id`, `Name`, `AppId`, `Format`, `Comment`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`) VALUES +INSERT INTO "AppNamespace" (`Id`, `Name`, `AppId`, `Format`, `Comment`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`) VALUES (2000, 'application', 'consumer-test-app-id-1', 'properties', 'default app namespace', 'apollo', 'apollo'); /*!40000 ALTER TABLE `AppNamespace` ENABLE KEYS */;