Cannot pass command with "-" sign in liquibase command line

hi guys, I’m new to liquibase, just started to research on it for 1 week, and i’m having an issue that really need you guys help

I’m trying to use command with “-” sign such as “rollback-count” or “update-to-tag” and I’m doing it in 2 ways:

  • the first one is based on the official document, without the “–command” option:
    liquibase --changelog-file=mychangelog.sql rollback-count 1
    → It throws error: Unexpected value ‘rollback-count’, options must start with a '–'

  • the second one is with the “–command” option:
    liquibase --changelog-file=mychangelog.sql --command=rollback-count 1
    → It throws error: Unexpected value ‘1’, options must start with a '–'

here is my command line, and the actual error message

no matter what i do, i still cannot get the command line to run. but if i dont use command with “-” sign, it works fine, such as “update” or “rollback tag1.1”

Is anybody know how to fix this problem?

thank you very much

Hi @minhben97 Can you try using rollbackCount 1 instead as the command to execute?
And thanks for joining the community.

The root cause of this is most likely the fact that, when running from CMD prompt, rollback-count is “split” in two, considering -count as a runtime parameter. I would try the same call from Powershell or use the --command and wrap that rollback-count in "

--command="rollback-count" 1

Hope this helps,
Eduard

i still got the same error tho, this time it says that “rollbackCount is not a option”

i still got the same error Unexpected value ‘1’, options must start with a '–'

does it has anything to do with the version of liquibase? i’m using 4.2.2, still cannot check whether it supports these kind of commands or not