Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Liquibase --username argument should be placed after the command #138

Open
ZooToby opened this issue Jan 11, 2024 · 0 comments
Open

Liquibase --username argument should be placed after the command #138

ZooToby opened this issue Jan 11, 2024 · 0 comments

Comments

@ZooToby
Copy link

ZooToby commented Jan 11, 2024

For some reason, when the database username is migrate and the username is specified before the command, liquibase will return the following error: Error parsing command line: Expected parameter for option '--username' but found 'migrate'.

example command which causes error:

liquibase --username=migrate --password=1234 --url="jdbc:postgresql://localhost:5432/sample" --changelog-file=path/to/changelog.yaml status

This also appears to affect --reference-username, eg:

liquibase --username=write --password=1234 --url="jdbc:postgresql://localhost:5432/sample" --reference-url="jdbc:postgresql://localhost:5433/sample" --reference-username=local --reference-password=1234 diff

I'm not sure why 'migrate' specifically is causing this error, however if the --username or --reference-username is placed after the command then it runs fine.

If the first command is changed to this it won't cause errors:

liquibase --password=1234 --url="jdbc:postgresql://localhost:5432/sample" --changelog-file=path/to/changelog.yaml status --username=migrate

I'm not sure if this is a documented error but it seems the fix would be to add USERNAME and REFERENCE_USERNAME to the POST_COMMAND_ARGUMENTS array in the LiquibaseCommand.groovy file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant