apolloconfig / apolloconfig/apollo

Apollo适配PostgreSQL数据库

Đang mở
#4,532 4 bình luận 1 reaction 0 người được giao Xem trên GitHub
info tips
Ngôn ngữ chính
Java
Star
29.8k
Fork
10.2k
Merge trung bình
4 ngày 7 giờ
Pull request đã merge (30 ngày)
4

Mô tả

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;

完结。

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.