dyc87112 / spring-cloud-config-admin

Spring Cloud Config的综合管理后台(简称:SCCA)
https://dyc87112.github.io/spring-cloud-config-admin-doc/
Apache License 2.0
658 stars 262 forks source link

property 表的定义方式 #94

Closed yingw closed 6 years ago

yingw commented 6 years ago

和现有 config-server 整合是否需要对现有 server 的 db 查询方式作出调整,spring 官方例子的 db 是 properties:

CREATE TABLE `properties` (
  `id` int(11) NOT NULL,
  `key` varchar(50) NOT NULL,
  `value` varchar(500) NOT NULL,
  `application` varchar(50) NOT NULL,
  `profile` varchar(50) NOT NULL,
  `label` varchar(50) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

就一张表,查询语句:

spring.cloud.config.server.jdbc.sql=SELECT `KEY`, `VALUE` from `properties` where APPLICATION=? and PROFILE=? and LABEL=?

plugin-db 中配置为:

spring.cloud.config.server.jdbc.sql=select `p_key`, `p_value` from property where application=? and profile=? and label=?

但是这个 property 表没有创建。将现有config server改成这个表和字段,也查不出当前配置信息,从配置中心获取可以(Eureka)

dyc87112 commented 6 years ago

对spring官方创建表的话,建议是把key和value两个列名改成p_key和p_value,不然管理部分的orm框架映射不上

yingw commented 6 years ago

谢谢,那我就改两个字段名吧。