-
-
Save 40a/8678b3ab95521db092304fc6e3b5ea8e 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