I have a question about the usage of the logicalFilePath
attribute and how it works. The goal is to move included changesets to another folder and not rerun the changesets.
The original dbchangelog.xml
with the following content:
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd"
>
<property name="path.generic" value="../../resources"/>
<includeAll path="${path.generic}">
</databaseChangeLog>
This I changed to:
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd"
>
<property name="path.generic.old" value="../../resources"/>
<property name="path.generic" value="../../../resources"/>
<includeAll logicalFilePath="${path.generic.old}" path="${path.generic}">
</databaseChangeLog>
If I check the logging then the hash is computed exactly the same for the changesets (with debug logging), however Liquibase still executes the changesets.
Is this because the check is (A) check if the filename exists (B) check the hash? I thought that it should check the filename with the logical filename and then check the hash
I found some (for me) conflicting information in [1] and [2]. In [1] I found the usage of logicalFilePath
for migration, but in [2] it hinted that it impacts the hash.
Does someone know the answer or how to debug this further?
Sources:
[1] How Liquibase Finds Files: Liquibase Search Path
[2] logicalFilePath
edit: I checked with versions 4.31 and 4.30