Flowable + Flyway + Spring Boot 2.2.2 not working

So, just to explain a little bit more. I’ve a database on a project that is been managed by Flyway, and because of that I had to add the code above in order to allow flowable to create the necessary tables without any complain from Flyway.

@Configuration
public class MigrationConfig {

    @Bean
    FlywayMigrationInitializer flywayInitializer(Flyway flyway) {
        return new FlywayMigrationInitializer(flyway, (f) ->{} );
    }

    @Bean
    @DependsOn("entityManagerFactory")
    FlywayMigrationInitializer delayedFlywayInitializer(Flyway flyway) {
        return new FlywayMigrationInitializer(flyway, null);
    }
}

This code works fine for spring-boot:2.1.4. But now I’m trying to upgrade to Spring Boot 2.2.2-RELEASE, and it not working anymore. I’ve found a closed issue for that over here Spring Boot Issue 18362, it mention Hibernate instead of Flowable but the problem is the same (need to create some tables before flyway migrate).

We had to make that because we are dropping some unused indexes from the tables created by flowable that were using a lot of space but were never been used.

What are my questions:

  1. Is that a way to work with Flowable + Flyway + Spring Boot 2.2.2-RELEASE? Does anyone had this same problem before?
  2. Maybe flowable has a way to create/drop indexes that I’m not familiar with. If so, I’d like to hear more about it.

Feel free to add any comment, or ask for any more clarifications about it!

  1. I don’t think that’s a common setup (hence the silence here)

  2. Every engine in Flowable has an implementation of this interface: flowable-engine/SchemaManager.java at master · flowable/flowable-engine · GitHub. You could add your own implementation and call it for example with an flowable-engine/EngineLifecycleListener.java at master · flowable/flowable-engine · GitHub implementation

Thanks for your answer!
Yeah, I imagined that this is not a common setup. But, I got the code as it is.
Just to mention I was able to make it work removing Flyway’s auto-configuration as described in this question https://stackoverflow.com/a/58989276

Well, I disagree. There are plenty of us using that. I think the silense is due to us that are using it are struggling ourselves. It is a bloody nightmare. Flowable does not seem to abide to any of the documented settings for turning OFF the build in liquibase automatic migration.

I for one feel our solution is ugly h4xx0r which I would not dare to publish.

Very happy to have any contribution to improve it there, and help the Flyway part of the community!

Cheers
Paul.

Can you please point us which are these documented settings that Flowable doesn’t abide by?

You can easily disable the Flowable manual creation of the database tables by setting flowable.database-schema-update to none or ignore.

On top of that Flyway has the concept of baselineOnMigrate that you can easily set by using

spring.flyway.baseline-on-migrate=true
spring.flyway.baseline-version=0.0.1

The baseline-version should be lower than your initial version.

Cheers,
Filip

We do not want Flowable to make any modifications to database structure, further more the application datasources can not even execute any DDL on runtime due to security reasons. Flyway for the Spring Boot application with embedded Flowable MUST be executed with different credentials and outside the application runtime. SO we have included the database creations scripts provided on Flowable site to our projects flyway change sets. Many of the instructions on web sites on how to turn off the build in migration do not seem to work,
My point was that is not clear and straighforward to set up. Specially as there are so many ways to set it up like internal or external use of flyway. Multiple migrations of the host app and the separate embedded Flyway or all-in-on migration etc. We ahve to use the same database/schema for the host app and embedded flyway and as result use the same Flyway and same migration.

I did not find a clear and consistent documented way of turning off auto-upgrade/migrate of the Flowable app on startup to delegate the database setup to extenal process.

Why did you ignore the first part of my reply?

You can also find this property here and also here in our documentation.