Hello,
Is this something that is on the Flowable roadmap? I suppose this is a rather common use case.
We also have a Spring Boot application that has two distinct database users: a primary user with DML rights (configured using property spring.datasource.username
in the Spring Boot application.yml
configuration file) for the normal operation of the application and a second user with DDL rights (configured using property spring.liquibase.user
) for running the Liquibase scripts when the application starts.
So the tables of our application are created/upgraded automatically by Liquibase using the spring.liquibase.user
DDL user when the application is deployed.
See also: “How-to” Guides
However when flowable.database-schema-update=true
Liquibase tries to create/upgrade the Flowable tables, it’s using the former user (with only DML rights), not the latter user (with DDL rights), so this fails.
To work around this problem, we have to set flowable.database-schema-update=none
and retrieve the necessary db scripts for Flowable (which can be found at Flowable Database Schema | Flowable Enterprise Documentation) and run them manually, which takes more time and is also error prone.
Another workaround might be to deploy the application first with the DDL user as spring.datasource.username
(so that the Flowable tables can be created/upgraded via Liquibase) and to do a second deployment afterwards with the DML user as spring.datasource.username
(which should then work as the Flowable tables will already have been created/upgraded during the previous deployment).
I haven’t tried this out yet, and I don’t know if this solution will be allowed inside our organisation either.
Anyway, this would mean we have to do two deployments instead of one each time Flowable is upgraded, which is not ideal either.
As for the workaround that is proposed above:
I don’t really understand what is meant by that and how it should be done. Is there an example of this solution I could have a look at?
Anyway, this will require additional development for each application that wants to use a distinct database user for Liquibase, so it’s probably not the best solution either.
So to summarize, it would be a big plus if Flowable (when deployed inside a Spring Boot application) would use the Spring Boot configuration to determine which database user should be used to update the database schema: spring.liquibase.user
if available and spring.datasource.username
otherwise.
Kind regards