2

and tried to rollback tag of liquibase in jhipster, but I do not succeed.

def liquibaseCommand(command) {
    javaexec {
        if (OperatingSystem.current().isWindows()) {
            classpath files(pathingLiquibaseJar.archivePath)
        } else {
            classpath sourceSets.main.runtimeClasspath
            classpath configurations.liquibase
        }
        main = "liquibase.integration.commandline.Main"

        args "--changeLogFile=src/main/resources/config/liquibase/changelog/" + buildTimestamp() +"_changelog.xml"
        args "--referenceUrl=hibernate:spring:cl.databin.fact.domain?dialect=org.hibernate.dialect.PostgreSQL82Dialect&hibernate.physical_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy&hibernate.implicit_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy"
        args "--username=postgres"
        args "--password=mypass"
        args "--url=jdbc:postgresql://localhost:5432/testdbjhipster"
        args "--driver=org.postgresql.Driver"
        args command
    }
}
task rollbackTag(dependsOn: initPaths) {
    doLast {
        liquibaseCommand("rollback")
    }
}

and when I execute

 ./gradlew rollbackTag -PliquibaseCommandValue=1.0.0-0.1

ERROR liquibase - rollback requires a rollback tag

Thank you!

  • 1
    You have not specified the name of the tag to roll back to in your command. You will also need to have previously applied a tag to the database using the liquibase 'tag' command. – SteveDonie Apr 18 '18 at 17:22
  • my solution was: def liquibaseCommand(command, tag) { javaexec { ... args "--driver=org.postgresql.Driver" args command args tag } } task rollbackTag(dependsOn: initPaths) { doLast { liquibaseCommand("rollback", "1.1.0") } } and then execute the command ./gradlew rollbackTag – Eduardo Rosales Fernández Apr 18 '18 at 19:20

0 Answers0