apolloportaldb-v080-v090.sql 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. --
  2. -- Copyright 2024 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 portal db from v0.8.0 to v0.9.0
  17. Use ApolloPortalDB;
  18. CREATE TABLE `Users` (
  19. `Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id',
  20. `Username` varchar(64) NOT NULL DEFAULT 'default' COMMENT '用户名',
  21. `Password` varchar(64) NOT NULL DEFAULT 'default' COMMENT '密码',
  22. `Email` varchar(64) NOT NULL DEFAULT 'default' COMMENT '邮箱地址',
  23. `Enabled` tinyint(4) DEFAULT NULL COMMENT '是否有效',
  24. PRIMARY KEY (`Id`)
  25. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户表';
  26. CREATE TABLE `Authorities` (
  27. `Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id',
  28. `Username` varchar(50) NOT NULL,
  29. `Authority` varchar(50) NOT NULL,
  30. PRIMARY KEY (`Id`)
  31. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  32. INSERT INTO `Users` (`Username`, `Password`, `Email`, `Enabled`)
  33. VALUES
  34. ('apollo', '$2a$10$7r20uS.BQ9uBpf3Baj3uQOZvMVvB1RN3PYoKE94gtz2.WAOuiiwXS', 'apollo@acme.com', 1);
  35. INSERT INTO `Authorities` (`Username`, `Authority`) VALUES ('apollo', 'ROLE_user');