I'm trying to integrate Liquibase to my company's application.
Our system uses Gradle as the build tool. I'm pretty new to Gradle.
I followed the following tutorial.
https://dzone.com/articles/managing-your-database-with-liquibase-and-gradle
I added the following to my build.gradle
file.
def changeLog = "dev/samplechangelog.h2.sql"
task ('dev') {
doLast {
println "executing dev"
liquibase {
activities {
main {
changeLogFile changeLog
url 'jdbc:postgresql://some_url:5432/postgres?currentSchema=schema_name'
username 'postgres'
password 'some_password'
}
runList = main
}
}
}
}
And added the dependencies as in the tutorial.
After I build the project, I can see the Gradle task 'dev' like below.
The tutorial says to run gradle task dev update
to run the gradle task.
But I think I should be able to do the same thing by double clicking the 'dev' task in the the 'Gradle' tab as in the above picture.
I put the update
as an argument like below.
After I double click the Gradle task 'dev' I get the following output.
Even though it says the Build is successful, it's not. The databasechangelog
table is not updated.
I can configm that the liquibase.properties
file has the correct properties because I run liquibase via the terminal it updates in the same DB.
Does anyone have any ideas why this happens?