Liquidbase Issue after upgrade

After upgrading jmix, upgrade script is generated every time for all fileref attributes (updating database doenot have any effect).

This is sample liquidbase script -

<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-4.11.xsd"
        objectQuotingStrategy="QUOTE_ONLY_RESERVED_WORDS">
    <changeSet id="1" author="SheelCompliance">
        <dropColumn columnName="FILE_" tableName="COM_NOTICE"/>
    </changeSet>
    <changeSet id="2" author="SheelCompliance">
        <addColumn tableName="COM_NOTICE">
            <column name="FILE_" type="VARCHAR(1024)"/>
        </addColumn>
    </changeSet>
    <changeSet id="3" author="SheelCompliance">
        <dropColumn columnName="FILE_" tableName="COM_PERMIT_FILE"/>
    </changeSet>
    <changeSet id="4" author="SheelCompliance">
        <addColumn tableName="COM_PERMIT_FILE">
            <column name="FILE_" type="VARCHAR(1024)"/>
        </addColumn>
    </changeSet>
</databaseChangeLog>

This is happening in all applications. Please advice.

Hi!
Which version of Jmix Studio do you use?
We’ve just fixed the same problem, you can see the fix in Jmix Studio version 1.3.6

upgraded to 1.3.6, still getting same issue

Hi, could you provide a test project, I have this problem is not reproducible.
In the latest release version, just this problem was fixed.

Test project is attached
test.zip (82.4 KB)

the Liquibase script name are like this-
Screenshot 2022-09-14 214449

the script contnet is -

<?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-4.11.xsd"
        objectQuotingStrategy="QUOTE_ONLY_RESERVED_WORDS">
    <changeSet id="1" author="test">
        <dropColumn columnName="FILE_" tableName="NEW_ENTITY"/>
    </changeSet>
    <changeSet id="2" author="test">
        <addColumn tableName="NEW_ENTITY">
            <column name="FILE_" type="VARCHAR(1024)"/>
        </addColumn>
    </changeSet>
</databaseChangeLog>

The upgrade has also created issues with the Quartz Add-On - all tables of quartz were removed by liquibase after the upgrade and then not recreated it seems. I have not had time to explore this so simply removed the add-on for now, but will need it to work soon.

Another issue is also after 1.3.6 JMIX Studio is installed the fileref field updates keep repeating on every build (assume they are not updated)

I don’t reproduce your problem even on your project. :frowning:
Perhaps after upgrading to the latest version, there was some kind of conflict in dependencies, so I suggest doing the following:

  1. Delete the cache in the root folder .gradle.
  2. Install a later version of Jmix (for example 1.2.2.), and then upgrade to the latest.

It seems that there really was a problem, but it was not reproduced for everyone and not on all databases. We have a ticket, everything will be fine in the next fix release.

This is happening to me too: Changelog created each time for FileRef field
Jmix 1.3.3
Jmix Studio 1.3.7-213
SQL Server

This bug is a major setback for me and harmful to production data is deployed (i.e. file ref fields will effectively be cleared)

What can I do ?

We are working on it: https://youtrack.jmix.io/issue/JST-3256
The fix (the final one) will be available in the next patch, most probably next week.
Meanwhile you should be able to add the invalid changelogs to Ignore list and they won’t appear again.

Sorry for this recurring problem.

1 Like

Thank you Konstantin !

Hello Konstantin,

I’m experiencing the same issue but I’m on the latest Jmix Studio version (2.0.4-232) and Jmix version 1.5.4. It generates modifyDataType changes for any FileRef field. Workaround is putting these changes into ignores.

Could please give me some piece of advise how to fix that?

Thank you

OG

1 Like

In the Jmix Studio plugin version 2.0.3-232 everything works fine.

OG

That bug is happening to me too.

I just upgraded to Jmix 1.5.4 and having the same issue.

For example, the following change log keeps being generated :

<?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-4.11.xsd"
        objectQuotingStrategy="QUOTE_ONLY_RESERVED_WORDS">
    <changeSet id="1" author="pnl">
        <modifyDataType columnName="PHOTO" newDataType="VARCHAR(1024)" tableName="PNL_EMPLOYEE"/>
    </changeSet>
    <changeSet id="2" author="pnl">
        <modifyDataType columnName="PHOTO" newDataType="VARCHAR(1024)" tableName="PNL_TRUCKER"/>
    </changeSet>
</databaseChangeLog>

Hi

Thanks for your feedback! The issue was fixed here: https://youtrack.jmix.io/issue/JST-4381. Fix will be available soon in the upcoming release 2.1.0.

2 Likes

Hi Alexander, thank you very much for quick fix!

Hi,
I m having the same issues where the Liquidbase keep on generating for all database every time I debug and run. FYI, I m using reverse engineering to generate the entity from oracle. And my concern is that, the liquiqbase is taking too much time.

I’d appreciate any insights or suggestions you might have on how to address this performance issue. Perhaps there are existing configuration options within Liquibase or Jmix debugging environment that could help.

Thanks in advance for your assistance.

Hi

Please describe the issue you faced. What kind of changelogs are being generated?

If Studio repeatedly generates some not valid changeset(s) you can ignore it. Select changeset in Changelog Preview dialog, click “minus” button and select Remove and Ignore option.
Screenshot 2024-06-21 at 11.26.56

But this won’t prevent Studio from running Liquibase diff generation process on every application start.

If you want to run application without comparing the current state of your JPA entities with the current database schema you need to create new run configuration that doesn’t have such before launch task.
Open Run/Debug Configurations dialog. Select your application run configuration, copy it and remove before launch task named “Check Jmix Database”. Then use this new run configuration to run/debug your application.

Screenshot 2024-06-21 at 11.37.05

But please note that with this task removed it is your responsibility to keep your database up-to-date with data model. “Generate Liquibase Changelog” action should be executed for datastore if data model changes.

Hi Alexander,

Thank you again for your prompt and helpful response.

I’m reaching out again because I’m facing a new challenge. I’m experiencing a slow generation time for Liquidbase. While debugging, I noticed that generating the Liquidbase itself seems to be taking a significant amount of time.

Could this be due to limitations of my device, or is there something else I might be overlooking?

I appreciate any insights you can offer.