V1.0.0__initialization.sql 20 KB

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