Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PostgreSQL适配 #1293

Closed
xiao0yy opened this issue Jul 25, 2018 · 2 comments
Closed

PostgreSQL适配 #1293

xiao0yy opened this issue Jul 25, 2018 · 2 comments

Comments

@xiao0yy
Copy link

xiao0yy commented Jul 25, 2018

由于想基于现有的CockroachDB部署一套Apollo,但官方文档中提供的适配方案不是很“友好”,所以重新做了一次PostgreSQL的适配。

PostgreSQL适配

基于apollo v0.10.2对PostgreSQL做了适配,主要内容:

  • 提供了"pg风格"的建表SQL: scripts/sql/pg-configdb.sqlscripts/sql/pg-portaldb.sql
    • 统一使用小写+下划线命名
    • 字符串全部使用TEXT
    • 某些状态字段使用BOOLEAN
  • 对全部@Entity及部分Repository进行相应适配
    • 表名字段名映射
    • SEQUENCE映射
    • 部分实体字段int -> boolean
    • 部分HQL调整
    • 部分SQL调整
  • Mysql Driver替换为PostgreSQL Driver(版本:42.2.4)
  • 加入hibernate.dialecthibernate.temp.use_jdbc_metadata_defaults配置(使CockroachDB可用)
  • 去掉spring.datasource.initSQL=set names utf8mb4

使用PostgreSQL 9.5CockroachDB 2.0.3手动测试通.

未做工作项

  • 单元测试调整
  • Docker测试

因为代码更改不适合PR,所以在issue中做了说明。如有不合规范的地方,请关闭issue。

@nobodyiam
Copy link
Member

非常感谢!后续我把文档更新一下

@ORGRUI
Copy link

ORGRUI commented Jun 28, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants