apolloconfigdb-v210-v220.sql 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. --
  2. -- Copyright 2022 Apollo Authors
  3. --
  4. -- Licensed under the Apache License, Version 2.0 (the "License");
  5. -- you may not use this file except in compliance with the License.
  6. -- You may obtain a copy of the License at
  7. --
  8. -- http://www.apache.org/licenses/LICENSE-2.0
  9. --
  10. -- Unless required by applicable law or agreed to in writing, software
  11. -- distributed under the License is distributed on an "AS IS" BASIS,
  12. -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. -- See the License for the specific language governing permissions and
  14. -- limitations under the License.
  15. --
  16. # delta schema to upgrade apollo config db from v2.1.0 to v2.2.0
  17. Use ApolloConfigDB;
  18. ALTER TABLE `App`
  19. MODIFY COLUMN `AppId` VARCHAR(64) NOT NULL DEFAULT 'default' COMMENT 'AppID';
  20. ALTER TABLE `Commit`
  21. MODIFY COLUMN `AppId` VARCHAR(64) NOT NULL DEFAULT 'default' COMMENT 'AppID';
  22. ALTER TABLE `Namespace`
  23. MODIFY COLUMN `AppId` VARCHAR(64) NOT NULL DEFAULT 'default' COMMENT 'AppID';
  24. ALTER TABLE `Release`
  25. MODIFY COLUMN `AppId` VARCHAR(64) NOT NULL DEFAULT 'default' COMMENT 'AppID';
  26. ALTER TABLE `AccessKey`
  27. MODIFY COLUMN `AppId` VARCHAR(64) NOT NULL DEFAULT 'default' COMMENT 'AppID';
  28. ALTER TABLE `Commit`
  29. DROP INDEX `AppId`,
  30. ADD INDEX `AppId` (`AppId`);
  31. ALTER TABLE `Namespace`
  32. DROP INDEX `UK_AppId_ClusterName_NamespaceName_DeletedAt`,
  33. ADD UNIQUE INDEX `UK_AppId_ClusterName_NamespaceName_DeletedAt` (`AppId`,`ClusterName`(191),`NamespaceName`(191),`DeletedAt`);
  34. ALTER TABLE `Release`
  35. DROP INDEX `AppId_ClusterName_GroupName`,
  36. ADD INDEX `AppId_ClusterName_GroupName` (`AppId`,`ClusterName`(191),`NamespaceName`(191),`DeletedAt`);