Have owner of Flowable tables be role based instead of user based using Flyway

I am trying to reconcile a difficulty in having Flowable play well with Flyway (for scripted database creation) using Spring Boot. The primary issue is that Flyway is role based, so the tables that it generates are owned by the role that I provide it. But tables in Flowable are owned by the user (provided by spring.datasource.username).

This works fine the first time I run my application. The Flyway scripts create all my tables, then Flowable creates all it’s tables. But Flyway manages it’s database scripts with a history table, and does not like the fact that the Flowable tables share the same schema with a different owner and things fall apart from there.

I can manually go in a change the owner of each table to be the same Role i am using with Flyway and that works, but that is a pain. So…

Is there a way to have Flowable create my tables with ownership going to a provided role, not the user?

…I am trying to retain the use of the same datasource for Flowable and Flyway

I’m not that up to date with how Flyway works, but I’m not yet following why the user you use with Flowable cannot have the right role? Also, which database are you using?

Thanks for taking the time to respond. I am using postgres. The user I use for connecting to Flowable via the spring datasource has the correct role, but when the tables are created, ownership is given to the user. I want ownership of the tables to be given to a role, so that any user with the role can operate on the tables. As it is now, only the credentialed user can operate on the tables.

I have solved the issue by modifying the sql scripts to assign ownership of the tables to the role i want, I just wanted to know if there was an out-of-the-box solution with spring boot so I don’t need custom stuff.