Adding Jmix-reports to a database previously migrated from Cuba

Hi all,

we have an old Jmix application that we previously migrated from Cuba. When we did the migration we had to set “main.liquibase.contexts=cuba” in the application.properties file of our environment to make sure our old Cuba database would be migrated to Jmix. Since then this property has been there and has had the value ‘cuba’.

Now, we want to add the Jmix Reports module to our application. But we run into the problem that Jmix thinks it has to migrate old report-tables from Cuba to Jmix. But there are no old reports tables! We want Jmix to create the reports tables! But how? Setting “main.liquibase.contexts=migrated” would add the reports tables, but in our case this does not work since it triggers many errors “tabel xyz already exists” for every table in our database (since Jmix thinks it has to create them also).

Any ideas?

Kind regards,
Bart

Hi Bart,

Please provide logs of scripts errors (“main.liquibase.contexts=cuba” scenario).
If you already went through migration scripts they should not be executed again (because they are already executed/marked as ran).

However there can be an issue with the “main” scripts or Reports which might be mistaken for issues with migration scripts.

Need to clarify.

Regards,
Ivan

I think the solution would be main.liquibase.contexts = cuba, migrated.
You have a problem with Jmix Reports trying to initialize its tables. These change logs are executed under the condition context ="!cuba".
And the migration of tables begins under the condition context ="!migrated"

We have an app that migrated from Cuba. We use main.liquibase.contexts = cuba if we want to upgrade an old application instance to a new Jmix-based version.
After migration, we set contexts = cuba, migrated this lets addons know that the tables do not need to be modified.