apolloconfigdb.sql 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413
  1. --
  2. -- Copyright 2021 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. /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
  17. /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
  18. /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
  19. /*!40101 SET NAMES utf8 */;
  20. /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
  21. /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
  22. /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
  23. # Create Database
  24. # ------------------------------------------------------------
  25. CREATE DATABASE IF NOT EXISTS ApolloConfigDB DEFAULT CHARACTER SET = utf8mb4;
  26. Use ApolloConfigDB;
  27. # Dump of table app
  28. # ------------------------------------------------------------
  29. DROP TABLE IF EXISTS `App`;
  30. CREATE TABLE `App` (
  31. `Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
  32. `AppId` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'AppID',
  33. `Name` varchar(500) NOT NULL DEFAULT 'default' COMMENT '应用名',
  34. `OrgId` varchar(32) NOT NULL DEFAULT 'default' COMMENT '部门Id',
  35. `OrgName` varchar(64) NOT NULL DEFAULT 'default' COMMENT '部门名字',
  36. `OwnerName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'ownerName',
  37. `OwnerEmail` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'ownerEmail',
  38. `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
  39. `DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
  40. `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  41. `DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
  42. `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  43. PRIMARY KEY (`Id`),
  44. KEY `AppId` (`AppId`(191)),
  45. KEY `DataChange_LastTime` (`DataChange_LastTime`),
  46. KEY `IX_Name` (`Name`(191))
  47. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='应用表';
  48. # Dump of table appnamespace
  49. # ------------------------------------------------------------
  50. DROP TABLE IF EXISTS `AppNamespace`;
  51. CREATE TABLE `AppNamespace` (
  52. `Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
  53. `Name` varchar(32) NOT NULL DEFAULT '' COMMENT 'namespace名字,注意,需要全局唯一',
  54. `AppId` varchar(64) NOT NULL DEFAULT '' COMMENT 'app id',
  55. `Format` varchar(32) NOT NULL DEFAULT 'properties' COMMENT 'namespace的format类型',
  56. `IsPublic` bit(1) NOT NULL DEFAULT b'0' COMMENT 'namespace是否为公共',
  57. `Comment` varchar(64) NOT NULL DEFAULT '' COMMENT '注释',
  58. `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
  59. `DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
  60. `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  61. `DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
  62. `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  63. PRIMARY KEY (`Id`),
  64. KEY `IX_AppId` (`AppId`),
  65. KEY `Name_AppId` (`Name`,`AppId`),
  66. KEY `DataChange_LastTime` (`DataChange_LastTime`)
  67. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='应用namespace定义';
  68. # Dump of table audit
  69. # ------------------------------------------------------------
  70. DROP TABLE IF EXISTS `Audit`;
  71. CREATE TABLE `Audit` (
  72. `Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
  73. `EntityName` varchar(50) NOT NULL DEFAULT 'default' COMMENT '表名',
  74. `EntityId` int(10) unsigned DEFAULT NULL COMMENT '记录ID',
  75. `OpName` varchar(50) NOT NULL DEFAULT 'default' COMMENT '操作类型',
  76. `Comment` varchar(500) DEFAULT NULL COMMENT '备注',
  77. `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
  78. `DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
  79. `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  80. `DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
  81. `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  82. PRIMARY KEY (`Id`),
  83. KEY `DataChange_LastTime` (`DataChange_LastTime`)
  84. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='日志审计表';
  85. # Dump of table cluster
  86. # ------------------------------------------------------------
  87. DROP TABLE IF EXISTS `Cluster`;
  88. CREATE TABLE `Cluster` (
  89. `Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
  90. `Name` varchar(32) NOT NULL DEFAULT '' COMMENT '集群名字',
  91. `AppId` varchar(64) NOT NULL DEFAULT '' COMMENT 'App id',
  92. `ParentClusterId` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '父cluster',
  93. `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
  94. `DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
  95. `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  96. `DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
  97. `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  98. PRIMARY KEY (`Id`),
  99. KEY `IX_AppId_Name` (`AppId`,`Name`),
  100. KEY `IX_ParentClusterId` (`ParentClusterId`),
  101. KEY `DataChange_LastTime` (`DataChange_LastTime`)
  102. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='集群';
  103. # Dump of table commit
  104. # ------------------------------------------------------------
  105. DROP TABLE IF EXISTS `Commit`;
  106. CREATE TABLE `Commit` (
  107. `Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
  108. `ChangeSets` longtext NOT NULL COMMENT '修改变更集',
  109. `AppId` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'AppID',
  110. `ClusterName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'ClusterName',
  111. `NamespaceName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'namespaceName',
  112. `Comment` varchar(500) DEFAULT NULL COMMENT '备注',
  113. `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
  114. `DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
  115. `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  116. `DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
  117. `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  118. PRIMARY KEY (`Id`),
  119. KEY `DataChange_LastTime` (`DataChange_LastTime`),
  120. KEY `AppId` (`AppId`(191)),
  121. KEY `ClusterName` (`ClusterName`(191)),
  122. KEY `NamespaceName` (`NamespaceName`(191))
  123. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='commit 历史表';
  124. # Dump of table grayreleaserule
  125. # ------------------------------------------------------------
  126. DROP TABLE IF EXISTS `GrayReleaseRule`;
  127. CREATE TABLE `GrayReleaseRule` (
  128. `Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
  129. `AppId` varchar(64) NOT NULL DEFAULT 'default' COMMENT 'AppID',
  130. `ClusterName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'Cluster Name',
  131. `NamespaceName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'Namespace Name',
  132. `BranchName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'branch name',
  133. `Rules` varchar(16000) DEFAULT '[]' COMMENT '灰度规则',
  134. `ReleaseId` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '灰度对应的release',
  135. `BranchStatus` tinyint(2) DEFAULT '1' COMMENT '灰度分支状态: 0:删除分支,1:正在使用的规则 2:全量发布',
  136. `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
  137. `DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
  138. `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  139. `DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
  140. `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  141. PRIMARY KEY (`Id`),
  142. KEY `DataChange_LastTime` (`DataChange_LastTime`),
  143. KEY `IX_Namespace` (`AppId`,`ClusterName`,`NamespaceName`)
  144. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='灰度规则表';
  145. # Dump of table instance
  146. # ------------------------------------------------------------
  147. DROP TABLE IF EXISTS `Instance`;
  148. CREATE TABLE `Instance` (
  149. `Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id',
  150. `AppId` varchar(64) NOT NULL DEFAULT 'default' COMMENT 'AppID',
  151. `ClusterName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'ClusterName',
  152. `DataCenter` varchar(64) NOT NULL DEFAULT 'default' COMMENT 'Data Center Name',
  153. `Ip` varchar(32) NOT NULL DEFAULT '' COMMENT 'instance ip',
  154. `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  155. `DataChange_LastTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  156. PRIMARY KEY (`Id`),
  157. UNIQUE KEY `IX_UNIQUE_KEY` (`AppId`,`ClusterName`,`Ip`,`DataCenter`),
  158. KEY `IX_IP` (`Ip`),
  159. KEY `IX_DataChange_LastTime` (`DataChange_LastTime`)
  160. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='使用配置的应用实例';
  161. # Dump of table instanceconfig
  162. # ------------------------------------------------------------
  163. DROP TABLE IF EXISTS `InstanceConfig`;
  164. CREATE TABLE `InstanceConfig` (
  165. `Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id',
  166. `InstanceId` int(11) unsigned DEFAULT NULL COMMENT 'Instance Id',
  167. `ConfigAppId` varchar(64) NOT NULL DEFAULT 'default' COMMENT 'Config App Id',
  168. `ConfigClusterName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'Config Cluster Name',
  169. `ConfigNamespaceName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'Config Namespace Name',
  170. `ReleaseKey` varchar(64) NOT NULL DEFAULT '' COMMENT '发布的Key',
  171. `ReleaseDeliveryTime` timestamp NULL DEFAULT NULL COMMENT '配置获取时间',
  172. `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  173. `DataChange_LastTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  174. PRIMARY KEY (`Id`),
  175. UNIQUE KEY `IX_UNIQUE_KEY` (`InstanceId`,`ConfigAppId`,`ConfigNamespaceName`),
  176. KEY `IX_ReleaseKey` (`ReleaseKey`),
  177. KEY `IX_DataChange_LastTime` (`DataChange_LastTime`),
  178. KEY `IX_Valid_Namespace` (`ConfigAppId`,`ConfigClusterName`,`ConfigNamespaceName`,`DataChange_LastTime`)
  179. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='应用实例的配置信息';
  180. # Dump of table item
  181. # ------------------------------------------------------------
  182. DROP TABLE IF EXISTS `Item`;
  183. CREATE TABLE `Item` (
  184. `Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id',
  185. `NamespaceId` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '集群NamespaceId',
  186. `Key` varchar(128) NOT NULL DEFAULT 'default' COMMENT '配置项Key',
  187. `Value` longtext NOT NULL COMMENT '配置项值',
  188. `Comment` varchar(1024) DEFAULT '' COMMENT '注释',
  189. `LineNum` int(10) unsigned DEFAULT '0' COMMENT '行号',
  190. `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
  191. `DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
  192. `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  193. `DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
  194. `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  195. PRIMARY KEY (`Id`),
  196. KEY `IX_GroupId` (`NamespaceId`),
  197. KEY `DataChange_LastTime` (`DataChange_LastTime`)
  198. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='配置项目';
  199. # Dump of table namespace
  200. # ------------------------------------------------------------
  201. DROP TABLE IF EXISTS `Namespace`;
  202. CREATE TABLE `Namespace` (
  203. `Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
  204. `AppId` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'AppID',
  205. `ClusterName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'Cluster Name',
  206. `NamespaceName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'Namespace Name',
  207. `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
  208. `DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
  209. `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  210. `DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
  211. `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  212. PRIMARY KEY (`Id`),
  213. KEY `AppId_ClusterName_NamespaceName` (`AppId`(191),`ClusterName`(191),`NamespaceName`(191)),
  214. KEY `DataChange_LastTime` (`DataChange_LastTime`),
  215. KEY `IX_NamespaceName` (`NamespaceName`(191))
  216. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='命名空间';
  217. # Dump of table namespacelock
  218. # ------------------------------------------------------------
  219. DROP TABLE IF EXISTS `NamespaceLock`;
  220. CREATE TABLE `NamespaceLock` (
  221. `Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  222. `NamespaceId` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '集群NamespaceId',
  223. `DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
  224. `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  225. `DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
  226. `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  227. `IsDeleted` bit(1) DEFAULT b'0' COMMENT '软删除',
  228. PRIMARY KEY (`Id`),
  229. UNIQUE KEY `IX_NamespaceId` (`NamespaceId`),
  230. KEY `DataChange_LastTime` (`DataChange_LastTime`)
  231. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='namespace的编辑锁';
  232. # Dump of table release
  233. # ------------------------------------------------------------
  234. DROP TABLE IF EXISTS `Release`;
  235. CREATE TABLE `Release` (
  236. `Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
  237. `ReleaseKey` varchar(64) NOT NULL DEFAULT '' COMMENT '发布的Key',
  238. `Name` varchar(64) NOT NULL DEFAULT 'default' COMMENT '发布名字',
  239. `Comment` varchar(256) DEFAULT NULL COMMENT '发布说明',
  240. `AppId` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'AppID',
  241. `ClusterName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'ClusterName',
  242. `NamespaceName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'namespaceName',
  243. `Configurations` longtext NOT NULL COMMENT '发布配置',
  244. `IsAbandoned` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否废弃',
  245. `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
  246. `DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
  247. `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  248. `DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
  249. `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  250. PRIMARY KEY (`Id`),
  251. KEY `AppId_ClusterName_GroupName` (`AppId`(191),`ClusterName`(191),`NamespaceName`(191)),
  252. KEY `DataChange_LastTime` (`DataChange_LastTime`),
  253. KEY `IX_ReleaseKey` (`ReleaseKey`)
  254. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='发布';
  255. # Dump of table releasehistory
  256. # ------------------------------------------------------------
  257. DROP TABLE IF EXISTS `ReleaseHistory`;
  258. CREATE TABLE `ReleaseHistory` (
  259. `Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id',
  260. `AppId` varchar(64) NOT NULL DEFAULT 'default' COMMENT 'AppID',
  261. `ClusterName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'ClusterName',
  262. `NamespaceName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'namespaceName',
  263. `BranchName` varchar(32) NOT NULL DEFAULT 'default' COMMENT '发布分支名',
  264. `ReleaseId` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '关联的Release Id',
  265. `PreviousReleaseId` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '前一次发布的ReleaseId',
  266. `Operation` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '发布类型,0: 普通发布,1: 回滚,2: 灰度发布,3: 灰度规则更新,4: 灰度合并回主分支发布,5: 主分支发布灰度自动发布,6: 主分支回滚灰度自动发布,7: 放弃灰度',
  267. `OperationContext` longtext NOT NULL COMMENT '发布上下文信息',
  268. `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
  269. `DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
  270. `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  271. `DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
  272. `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  273. PRIMARY KEY (`Id`),
  274. KEY `IX_Namespace` (`AppId`,`ClusterName`,`NamespaceName`,`BranchName`),
  275. KEY `IX_ReleaseId` (`ReleaseId`),
  276. KEY `IX_DataChange_LastTime` (`DataChange_LastTime`)
  277. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='发布历史';
  278. # Dump of table releasemessage
  279. # ------------------------------------------------------------
  280. DROP TABLE IF EXISTS `ReleaseMessage`;
  281. CREATE TABLE `ReleaseMessage` (
  282. `Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
  283. `Message` varchar(1024) NOT NULL DEFAULT '' COMMENT '发布的消息内容',
  284. `DataChange_LastTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  285. PRIMARY KEY (`Id`),
  286. KEY `DataChange_LastTime` (`DataChange_LastTime`),
  287. KEY `IX_Message` (`Message`(191))
  288. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='发布消息';
  289. # Dump of table serverconfig
  290. # ------------------------------------------------------------
  291. DROP TABLE IF EXISTS `ServerConfig`;
  292. CREATE TABLE `ServerConfig` (
  293. `Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id',
  294. `Key` varchar(64) NOT NULL DEFAULT 'default' COMMENT '配置项Key',
  295. `Cluster` varchar(32) NOT NULL DEFAULT 'default' COMMENT '配置对应的集群,default为不针对特定的集群',
  296. `Value` varchar(2048) NOT NULL DEFAULT 'default' COMMENT '配置项值',
  297. `Comment` varchar(1024) DEFAULT '' COMMENT '注释',
  298. `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
  299. `DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
  300. `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  301. `DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
  302. `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  303. PRIMARY KEY (`Id`),
  304. KEY `IX_Key` (`Key`),
  305. KEY `DataChange_LastTime` (`DataChange_LastTime`)
  306. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='配置服务自身配置';
  307. # Dump of table accesskey
  308. # ------------------------------------------------------------
  309. DROP TABLE IF EXISTS `AccessKey`;
  310. CREATE TABLE `AccessKey` (
  311. `Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
  312. `AppId` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'AppID',
  313. `Secret` varchar(128) NOT NULL DEFAULT '' COMMENT 'Secret',
  314. `IsEnabled` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: enabled, 0: disabled',
  315. `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
  316. `DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
  317. `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  318. `DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
  319. `DataChange_LastTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  320. PRIMARY KEY (`Id`),
  321. KEY `AppId` (`AppId`(191)),
  322. KEY `DataChange_LastTime` (`DataChange_LastTime`)
  323. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='访问密钥';
  324. # Config
  325. # ------------------------------------------------------------
  326. INSERT INTO `ServerConfig` (`Key`, `Cluster`, `Value`, `Comment`)
  327. VALUES
  328. ('eureka.service.url', 'default', 'http://localhost:8080/eureka/', 'Eureka服务Url,多个service以英文逗号分隔'),
  329. ('namespace.lock.switch', 'default', 'false', '一次发布只能有一个人修改开关'),
  330. ('item.key.length.limit', 'default', '128', 'item key 最大长度限制'),
  331. ('item.value.length.limit', 'default', '20000', 'item value最大长度限制'),
  332. ('config-service.cache.enabled', 'default', 'false', 'ConfigService是否开启缓存,开启后能提高性能,但是会增大内存消耗!');
  333. /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
  334. /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
  335. /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
  336. /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
  337. /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
  338. /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;