Comments (9)
Would you mind adding one more thing to this? After running an update with Ant, show the results of running select * from DATABASECHANGELOG
, and then do the same thing after running an update from the command line. I suspect that the issue is that the filename
column in each will be slightly different, and that is what the underlying issue is.
from liquibase.
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:
id | author | filename | dateexecuted | orderexecuted | exectype | md5sum | description | comments | tag | liquibase | contexts | labels | deployment_id
---------+--------+-----------------------------------------------------------------------------------------------------------+----------------------------+---------------+----------+------------------------------------+-------------------------------------------------------------------------------------------------------------+----------+-----+-----------+----------+--------+---------------
initial | aller | /workplace/<full path to my project>/schema/db.changelog-master.xml | 2020-03-23 16:32:06.647243 | 1 | EXECUTED | 8:4af49915b417de20e16855073c2569f0 | createTable tableName=<snip>; createIndex indexName=<snip>, tableName=<snip> | | | 3.8.8 | | | 4981126588
(1 row)
CLI:
id | author | filename | dateexecuted | orderexecuted | exectype | md5sum | description | comments | tag | liquibase | contexts | labels | deployment_id
---------+--------+--------------------------------+----------------------------+---------------+----------+------------------------------------+-------------------------------------------------------------------------------------------------------------+----------+-----+-----------+----------+--------+---------------
initial | aller | schema/db.changelog-master.xml | 2020-03-23 16:33:50.881025 | 1 | EXECUTED | 8:4af49915b417de20e16855073c2569f0 | createTable tableName=<snip>; createIndex indexName=<snip>, tableName=<snip> | | | 3.8.8 | | | 4981230827
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?
from liquibase.
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.
from liquibase.
Yeah, I think that is something we should look into with Ant. Seems to me like it should be using the relative path.
The other "workaround" is to actually specify the changelog path in the changelog itself.
There is an attribute you can put at the root of a changelog file named logicalFilePath
that you can set. You might set yours to schema/db.changelog-master.xml
and then it should work in both cases.
from liquibase.
Cool, I'll give that logicalFilePath
thing a try.
As for next steps, it's up to you. As a user, this is surprising and frustrating behavior 😅
from liquibase.
Hi @MaxAller. Did Steve's suggestion of using logicalFilePath
work for you?
from liquibase.
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 location
attribute of <property>
will make an absolute path based on the ant project base directory (defined in the basedir
attribute of the <project>
. It sounds like the changeLogFile
attribute is designed to be a relative path so to keep consistency with the CLI, making it a standard value will do that.
It might be a good idea to document that the ant task changeLogFile
attribute should be a relative path so that others don't encounter this issue. If they need full paths they should leverage the changeLogDirectory
attribute as well.
Hope this helps.
from liquibase.
Hi @MaxAller Did @mattbertolini 's suggestion work for you? If so, I'll make sure that the documentation gets updated appropriately. @mccormickc
from liquibase.
We should close this issue once we have a doc ticket.
from liquibase.
Related Issues (20)
- SQL_CHECK_POSTGRES_SEQUENCE_EXISTS in serialized xml changeset HOT 1
- Liquibase 4.26.0 multi-threading issue caused by cached prepared statements HOT 1
- Eligible changesets not getting executed after 4.20.0 HOT 3
- The maxDepth and minDepth attributes of includeall don't work as documented HOT 4
- High Level API HOT 1
- Warning when precondition references column starting with underscore HOT 3
- Java Command scope issues
- BUG: Quoting not always identified properly, causes issues in end delimiter identification HOT 9
- Check for equality on ran statement breaks when changelog has "classpath:" as logicalFilePath HOT 3
- Exception Primary Reason: Unexpected node found under databaseChangeLog: changes HOT 1
- generate-changelog Fails Without Identifying View or Creating Changelog File Due to Invalid String Encoding Error HOT 1
- Release timing of 4.26.1 for critical CVE HOT 3
- Error when installing on RedHat 8 HOT 3
- Liquibase and SQLite doesn't work with NoClassDefFoundError: org/slf4j/LoggerFactory error HOT 9
- Unknown Column Error caused by precondition in addColumn changeSet HOT 4
- Oracle takes too long to process a simple .csv file HOT 2
- Getting Databricks error using an Oracle jdbc URL HOT 6
- MS SQL Server script generation puts DATABASECHANGELOGLOCK prior to USE statement HOT 2
- changeset with relative path deployed with liquibase 4.6.0 to 4.23.1 are replayed with liquibase > 4.23.1 HOT 4
- Dead links in the README file HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from liquibase.