Commit 4c4c9a28 authored by Matija Obreza's avatar Matija Obreza

Database config for Postgres

parent 5098e5ce
......@@ -87,7 +87,7 @@
<aspectj.version>1.8.9</aspectj.version>
<mysql.version>5.1.46</mysql.version>
<postgres.version>42.2.5</postgres.version>
<hazelcast.version>3.8.1</hazelcast.version>
<oval.version>1.81</oval.version>
......@@ -363,9 +363,9 @@
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql.version}</version>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>${postgres.version}</version>
</dependency>
<!--Other dependencies -->
......
package org.genesys2.spring.config;
import java.util.UUID;
import org.hibernate.dialect.PostgreSQL9Dialect;
import org.hibernate.metamodel.spi.TypeContributions;
import org.hibernate.service.ServiceRegistry;
import org.hibernate.type.PostgresUUIDType;
public class CustomPostgreSQL9Dialect extends PostgreSQL9Dialect {
private final PostgresUUIDType postgresUUIDType = new PostgresUUIDType() {
private static final long serialVersionUID = 1L;
@Override
public String getName() {
return UUID.class.getName();
}
};
@Override
public void contributeTypes(TypeContributions typeContributions, ServiceRegistry serviceRegistry) {
super.contributeTypes(typeContributions, serviceRegistry);
typeContributions.contributeType(postgresUUIDType);
}
}
......@@ -49,13 +49,13 @@ build.revision=${buildNumber}
# robots.txt
robots.allow=false
db.url=jdbc:mysql://localhost/genesys?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
db.driverClassName=com.mysql.jdbc.Driver
db.username=root
db.password=
db.url=jdbc:postgresql://localhost:5432/genesys?stringtype=unspecified
db.driverClassName=org.postgresql.Driver
hibernate.dialect=org.genesys2.spring.config.CustomPostgreSQL9Dialect
db.username=genesys
db.password=genesys
db.showSql=false
db.hbm2ddl=false
hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect
# bit.ly shortener
# TODO change access token and guid
......
......@@ -8,6 +8,9 @@ hibernate.order_updates=true
hibernate.order_inserts=true
hibernate.jdbc.batch_versioned_data=true
# Postgres
hibernate.jdbc.use_streams_for_binary=false
hibernate.cache.use_second_level_cache=true
hibernate.cache.use_query_cache=false
hibernate.cache.use_minimal_puts=true
......
......@@ -7,16 +7,18 @@ changeLogFile=src/main/resources/liquibase/liquibase-changeLog.yml
#password=
#driver=com.mysql.jdbc.Driver
# Uncomment for mvn liquibase:diff
diffChangeLogFile=src/main/resources/liquibase/liquibase-diff-changeLog.yml
## &hibernate.ejb.naming_strategy=org.hibernate.cfg.ImprovedNamingStrategy
# Existing database
url=jdbc:mysql://localhost/genesys20181126?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
username=root
password=
driver=com.mysql.jdbc.Driver
# Upgraded database
referenceUrl=jdbc:mysql://localhost/genesys?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
referenceDriver=com.mysql.jdbc.Driver
referenceUsername=root
referencePassword=
## Uncomment for mvn liquibase:diff
#verbose=true
#logging=debug
#diffChangeLogFile=src/main/resources/liquibase/liquibase-diff-changeLog.yml
## Current database
#url=jdbc:postgresql://localhost:5432/genesys?stringtype=unspecified
#username=mobreza
#password=
#driver=org.postgresql.Driver
## Base database
#referenceUrl=jdbc:postgresql://localhost:5432/genesys2?stringtype=unspecified
#referenceDriver=org.postgresql.Driver
#referenceUsername=mobreza
#referencePassword=
#
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment