Skip to content

Commit

Permalink
Optimising ServiceRegistry creation SQL (#4792)
Browse files Browse the repository at this point in the history
* add tech-support-qq-4.png

* Update README.md

* Enhance the user experience in the scenario of submitting duplicate keys

* Modify the key-value conflict exception prompt, adjust the code style

* chore(apollo-scripts): Optimising the creation of ServiceRegistry SQL

* chore(apollo-scripts): Optimising the creation of ServiceRegistry SQL

---------

Co-authored-by: Jason Song <nobodyiam@gmail.com>
  • Loading branch information
klboke and nobodyiam authored Mar 14, 2023
1 parent a5ae97f commit a6c7aa6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions scripts/sql/apolloconfigdb.sql
Original file line number Diff line number Diff line change
Expand Up @@ -422,8 +422,8 @@ CREATE TABLE `ServiceRegistry` (
`Uri` VARCHAR(64) NOT NULL COMMENT '服务地址',
`Cluster` VARCHAR(64) NOT NULL COMMENT '集群,可以用来标识apollo.cluster或者网络分区',
`Metadata` VARCHAR(1024) NOT NULL DEFAULT '{}' COMMENT '元数据,key value结构的json object,为了方面后面扩展功能而不需要修改表结构',
`DataChange_CreatedTime` TIMESTAMP NOT NULL COMMENT '创建时间',
`DataChange_LastTime` TIMESTAMP NOT NULL COMMENT '最后修改时间',
`DataChange_CreatedTime` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`DataChange_LastTime` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
PRIMARY KEY (`Id`),
UNIQUE INDEX `IX_UNIQUE_KEY` (`ServiceName`, `Uri`),
INDEX `IX_DataChange_LastTime` (`DataChange_LastTime`)
Expand Down
4 changes: 2 additions & 2 deletions scripts/sql/delta/v200-v210/apolloconfigdb-v200-v210.sql
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ CREATE TABLE `ServiceRegistry` (
`Uri` VARCHAR(64) NOT NULL COMMENT '服务地址',
`Cluster` VARCHAR(64) NOT NULL COMMENT '集群,可以用来标识apollo.cluster或者网络分区',
`Metadata` VARCHAR(1024) NOT NULL DEFAULT '{}' COMMENT '元数据,key value结构的json object,为了方面后面扩展功能而不需要修改表结构',
`DataChange_CreatedTime` TIMESTAMP NOT NULL COMMENT '创建时间',
`DataChange_LastTime` TIMESTAMP NOT NULL COMMENT '最后修改时间',
`DataChange_CreatedTime` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`DataChange_LastTime` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
PRIMARY KEY (`Id`),
UNIQUE INDEX `IX_UNIQUE_KEY` (`ServiceName`, `Uri`),
INDEX `IX_DataChange_LastTime` (`DataChange_LastTime`)
Expand Down

0 comments on commit a6c7aa6

Please sign in to comment.