Closed karenc closed 7 years ago
@reedstrm
If the above works (do super first) then this is good to go, with a note in the template, maybe?
The only problem I see with this approach is it is a new connection, if what runs in the superuser() block depends on what happens before it, it's not going to be committed to the database yet (I think?). We might have a partially migrated database as well, because the superuser() stuff might succeed while the code after that might fail and not get committed.
But that's something to keep in mind when writing the migrations, implementing superuser() in db-migrator isn't a problem.
(From https://github.com/karenc/db-migrator/issues/38#issuecomment-322406117)
Add super_user() context manager that can be used in migrations when a database super user connection is necessary.
Close #38