Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM postgres

ENV POSTGRES_PASSWORD=postgres_extensions
ENV POSTGRES_USER=postgres_extensions
ENV POSTGRES_DB=pg_extensions_test

RUN echo "CREATE EXTENSION hstore" >> /docker-entrypoint-initdb.d/hstore.sql
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.PHONY: test

image :
docker build -f Dockerfile -t grails/postgres-extensions .

test :
./gradlew clean ;\
docker run --rm --name pg_extensions_test -p 5432:5432 -d grails/postgres-extensions ;\
./gradlew check ;\
docker container kill pg_extensions_test

all : image test
11 changes: 3 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ buildscript {
}
dependencies {
classpath "org.grails:grails-gradle-plugin:$grailsVersion"
classpath "org.grails.plugins:hibernate5:${gormVersion - '.RELEASE'}"
classpath "org.grails.plugins:hibernate5:7.0.0"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better use ${gormVersion} instead of 7.0.0, you already have gormVersion=7.0.2.RELEASE in the gradle.properties

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zhuravskiy the hibernate plugin isn't released in lock-step w/ the gorm plugin. The latest version available of org.grails.plugins:hibernate5 is 7.0.1 (see here). So it seems it may have been a mistake to depend on gormVersion for defining that. I'm guessing that was a relic from when the GORM plugins were organized differently, and shouldn't apply anymore.

Therefore, I just used the same versions as given in a fresh Grails 4.0 project.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zhuravskiy Thank you for reviewing!

classpath 'net.saliman:gradle-cobertura-plugin:2.5.4'
classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.8.2'
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.0"
}
}

version '6.1.0'
version '7.0.0'
group 'org.grails.plugins'

apply plugin: 'eclipse'
Expand Down Expand Up @@ -75,10 +75,9 @@ dependencies {
profile 'org.grails.profiles:web-plugin'
provided 'org.grails:grails-plugin-services'
provided 'org.grails:grails-plugin-domain-class'
testCompile 'org.grails:grails-plugin-testing'
testCompile 'org.grails:grails-gorm-testing-support'

provided 'org.postgresql:postgresql:42.2.2'
provided 'org.postgresql:postgresql:42.2.6'

// plugins
provided 'org.grails.plugins:hibernate5'
Expand All @@ -91,10 +90,6 @@ dependencies {
compile 'com.google.code.gson:gson:2.8.4'
}

task wrapper(type: Wrapper) {
gradleVersion = gradleWrapperVersion
}

bintray {
pkg {
userOrg = 'kaleidos'
Expand Down
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
gradleWrapperVersion=4.7
grailsVersion=3.3.5
hibernateVersion=5.2.17.Final
gormVersion=6.1.9.RELEASE
gradleWrapperVersion=5.1.1
grailsVersion=4.0.0
hibernateVersion=5.4.0.Final
gormVersion=7.0.2.RELEASE
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.7-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import net.kaleidos.hibernate.usertype.ArrayType
import net.kaleidos.hibernate.usertype.HstoreMapType
import net.kaleidos.hibernate.usertype.JsonMapType
import net.kaleidos.hibernate.usertype.JsonbMapType
import org.hibernate.dialect.PostgreSQL94Dialect
import org.hibernate.dialect.PostgreSQL95Dialect

import java.sql.Types

@CompileStatic
class PostgresqlExtensionsDialect extends PostgreSQL94Dialect {
class PostgresqlExtensionsDialect extends PostgreSQL95Dialect {

private static final String SEQUENCE_PER_TABLE = 'dataSource.postgresql.extensions.sequence_per_table'

Expand Down