4.1.2 or later
cli and Java
PG 9.6.2
Linux
(Please include the content causing the issue, any relevant configuration settings, and the command you ran)
I have a beforeMigrate.sql that looks like this:
SET ROLE migration_user;
And then many regular migrations which need to be run as the user migration_user.
I expect to see the entire migration session run as user migration_user, so that this role owns all of the created objects.
In fixing #1537, this RESET ROLE was added, which undoes the callback and any initSqls which use SET ROLE. I think this is unexpected.
Place it in beforeEachMigrate.sql instead and it should work as expected.
beforeEachMigrate.sql does not seem to be executed before schema_version creation. How can I ensure schema_version is created by the given user?
It would be great if this statement was controlled with some configuration flag:
jdbcTemplate.execute("RESET ROLE");
Most helpful comment
beforeEachMigrate.sql does not seem to be executed before schema_version creation. How can I ensure schema_version is created by the given user?
It would be great if this statement was controlled with some configuration flag:
jdbcTemplate.execute("RESET ROLE");