-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Ant task and CLI produce different changeset digests #1048
Comments
Would you mind adding one more thing to this? After running an update with Ant, show the results of running |
I was close to resolving this issue because I couldn't repro anymore, but actually I can now after rolling back some of my changes. If you have a db.changelog-master.xml file that includes another file, that works in both cases. However, if all your changesets are instead direcly in db.changelog-master.xml, that doesn't work. (With the tools consuming db.changelog-master.xml in both cases, obviously). Now for what you asked for, when only using a single changelog file: State when running with Ant first:
CLI:
Indeed, your guess was correct. In my Ant invocation, the path is an absolute path. In every other case, it's a relative path. I was thinking LiquiBase should always convert the path to absolute, but that wouldn't be portable across different systems, right? So...is this anything more than a convoluted user error? |
Er, actually I'd assumed that I was the one passing an absolute path into Ant, but in fact either Ant or the LiquiBase task is converting my relative path into an absolute path. The workaround is not to put changesets directly in that file. |
Yeah, I think that is something we should look into with Ant. Seems to me like it should be using the relative path. There is an attribute you can put at the root of a changelog file named |
Cool, I'll give that As for next steps, it's up to you. As a user, this is surprising and frustrating behavior 😅 |
Hi @MaxAller. Did Steve's suggestion of using |
I recreated the issue described and solved it by changing the following line: <property name="db.changelog" location="schema/db.changelog-master.xml" /> to: <property name="db.changelog" value="schema/db.changelog-master.xml" /> This is because the It might be a good idea to document that the ant task Hope this helps. |
Hi @MaxAller Did @mattbertolini 's suggestion work for you? If so, I'll make sure that the documentation gets updated appropriately. @mccormickc |
We should close this issue once we have a doc ticket. |
Description
If you run
<liquibase:updateDatabase .../>
using Ant, and subsequently runliquibase update
using the CLI, the CLI command will fail ("table already exists") since it'll try to run changesets that have already been applied.To Reproduce
I've been using the changeset from the tutorial here and running it against an Aurora PostgreSQL database from a Linux host.
On the Ant side, I have something like this:
Then on the CLI side, this:
liquibase.properties is
Version is LiquiBase 3.8.8.
Expected behavior
If I have an unapplied changeset, I would expect that running the Ant update task or the liquibase CLI update task in sequence, in either order, to work without throwing errors.
Screenshots
N/A
Additional context
Realistically I don't expect to be using the CLI for updates some of the time and Ant for updates the rest of the time. But it does call into question whether the CLI's reflective operations will be able to correctly identify which changesets have run. We might use the CLI sometimes because the functionality it offers is a superset of what the Ant tasks offer, so I'd like to be assured that it'll actually work when we need it.
The text was updated successfully, but these errors were encountered: