Last active
November 4, 2019 06:20
-
-
Save whyoleg/63195b60eb85e8fe2114b30f28b892ef to your computer and use it in GitHub Desktop.
JOOQ with flyway and gradle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.opentable.db.postgres.embedded.* | |
import org.flywaydb.core.* | |
import org.jooq.codegen.* | |
tasks.named("compileKotlin") { | |
doFirst { | |
//create embedded postgresql | |
EmbeddedPostgres.builder().setPort(5400).start().use { | |
//migrate embedded posrtgresql | |
Flyway.configure() | |
.locations("filesystem:$projectDir/migrations/") | |
.schemas("public") | |
.dataSource(it.postgresDatabase) | |
.load() | |
.migrate() | |
//generate jooq classes | |
GenerationTool.generate("some xml for jooq") | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment