Studio doesn't create liquibase script to create entities when connected to a new main database

I have a composite project where I am using an MS SQL server database and working ok. When I am trying to use a new database in PostgreSQL as the main data source, the studio creates the database with only a few tables used by security and addon modules, nothing created by me.

I have found this post in the forum that looks having the same issue.

I gave try in several ways e.g. creating the database (not the tables) from PgAdmin4 and creating/recreating through the studio, all worked fine except creating the entities I have defined within the project. When I create liquibase changelog, I get the message that “the database is already synchronized with the model” but in reality, it’s not.

I have tried to connect and sync with a new database in the SQL server, but it happened the same. Therefore, maybe it is not database dependent but how it works or not works.

I’m using the latest version of Jmix Studio and framework (v 2.1.1). I have attached the idea.log file that may help diagnose the issue.
idea.log.zip (129.0 KB)

Hello,


2023-12-14 23:19:49,461 [ 151849]   WARN - liquibase.ext - Diff changelog command failed

We were recently notified of a similar issue, but we don’t yet fully understand the cause of the error. Please install the nightly version of the plugin and run changelog generation again. A more detailed stack trace should appear in the log. Please provide this new log. Thank you.

Hi Timur
I have updated the plugin to nightly and then run the database script. Here is the script attached.
idea.log.zip (389.4 KB)

I have deleted the previously created postgreSQL database and generated the liquibase database script again which is attached again.
idea.log.zip (413.4 KB)

I have the same problem, I can’t get any further, no real stacktrace is ejected.

I have already set up a clean project and even there Liquibase stopped working after a short time.

Hi

Please make sure the NIGHTLY version is installed
We see Jmix (2.1.1-232) plugin version in the idea.log provided

Hi Alex
Which nightly version do you want me to install, I see the following studio nightly:
2.1.NIGHTLY1270-232 looks like the final version released.

I see the following nightly version of the platform:
image

I have used 2.1.999-SNAPSHOT.

Noe I think I have found the reason of such behavior of the studio. After I had installed this nightly version, the liquibase reported some errors which were mainly coming from invalid foreign keys. It is a matter of fact that, the foreign keys are not removed from the table even after the foreign key field is removed and thus the redundant foreign key is giving such an exception. This exception was not reported by v 2.1.1
idea.log.zip (160.0 KB)

Now liquibase is generating scrips for the database update. However, running script wasn’t successful, noticing duplicate scripts, one from version 2.1.1 and another from the nightly version as below:


[2023-12-21 19:54:50] INFO [liquibase.database] Set default schema name to public
Unexpected error running Liquibase: Found 2 files with the path '/io/jmix/data/liquibase/changelog.xml':
    - jar:file:/Users/mak/.gradle/caches/modules-2/files-2.1/io.jmix.data/jmix-data/2.1.1/5ede51db58692fda77132652a613969b5c1842b1/jmix-data-2.1.1.jar!/io/jmix/data/liquibase/changelog.xml
    - jar:file:/Users/mak/.gradle/caches/modules-2/files-2.1/io.jmix.data/jmix-data/2.1.999-SNAPSHOT/38058ea199e6b755fb0702843ca5f77107242343/jmix-data-2.1.999-SNAPSHOT.jar!/io/jmix/data/liquibase/changelog.xml
  Search Path: 
    - /Users/mak/Projects/inteaccHCM/inteacc/src/main/resources

I put the following code in application.properties liquibase.duplicateFileMode=WARN
but no change!

Hi

Studio nightly version was needed exactly to get Liquibase errors reports. I’m glad it helped to find the cause of changelog generation failure.

Regarding Jmix 2.1.999-SNAPSHOT.
We recommend to use stable Jmix versions, as SNAPSHOT versions didn’t pass full QA process.
Liquibase update error above seems to be caused by two jmix dependencies with different versions in the classpath. I guess this can happen in composite project with subprojects having different Jmix versions.
So using only Jmix 2.1.1 should solve the issue.

HI
I wasn’t using the nightly version but 2.1.1. I have sent you the log from the nightly version as suggested. As I was already using version 2.1.1, I am not sure what makes this to be working using the same version that didn’t work earlier.