apolloconfig / apolloconfig/apollo

Apollo适配PostgreSQL数据库

Abierto
#4,532 4 comentarios 1 reacción 0 asignados Ver en GitHub
info tips
Lenguaje dominante
Java
Estrellas
29.8k
Forks
10.2k
Merge medio
4 d 7 h
PR fusionados (30 d)
4

Descripción

apollo使用版本:1.5.1
postgreSQL驱动:
`
org.postgresql
postgresql
42.4.0
`

适配改动主要有4个要点,描述如下:
1、修改初始化sql脚本(ApolloConfigDB.sql、ApolloPortalDB.sql),
a、修改3个字段的类型,如下:
IsDeleted smallint DEFAULT 0 ,
IsAbandoned boolean DEFAULT false NOT NULL,
IsPublic boolean DEFAULT false NOT NULL,
b、pg索引是全局的,注意索引唯一性(重复的可以使用,下划线+数字 解决此问题)
c、sql语句中表名和字段名全部不加双引号、反引号
d、去掉语句中的(191),直接替换为空

2、application-github.propperties中的配置如下:
spring.jpa.database-platform = org.hibernate.dialect.PostgreSQLDialect
spring.datasource.driver-class-name = org.postgresql.Driver
spring.jpa.properties.hibernate.globally_quoted_identifiers=false
spring.jpa.hibernate.globally_quoted_identifiers=false
spring.jpa.properties.hibernate.temp.use_jdbc_metadata_defaults=false
spring.datasource.hikari.connectionInitSql=

3、启动脚本中增加环境变量配置:
-Duser.timezone=Asia/Chongqing

4、修改BaseEntity类里的isDelete的类型为int
@Column(name = "IsDeleted", columnDefinition = "Bit default '0'")
protected int deleted = 0;
public int getDeleted() {
return deleted;
}
public void setDeleted(boolean isDeleted) {
deleted = (!isDeleted ? 0 : 1);
}

5、修改Item.java 、Release.java、Commit.java 三个类中带有@lob的字段,在@lob注解处增加:@org.hibernate.annotations.Type(type = "org.hibernate.type.TextType"),例如:
@Column(name = "value")
@org.hibernate.annotations.Type(type = "org.hibernate.type.TextType")
@Lob
private String value;

完结。

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.