Closed ckrew closed 1 week ago
Removing the "SUPERUSER" role as part of this PR to cover #1069
Removing the "SUPERUSER" role as part of this PR to cover #1069
This actually caused the tests to fail so I added it back in so we could get this merged.
Description
This merge request addresses an issue with the tethys db create CLI command. The issue occurs when multiple portals are trying to share a single database with the same tethys_super table. If the tethys_super table already exists, then the tethys db create CLI command will try to create the tethys_super table, fail to do so, and then exit before the table for the portal is created.
This merge request sets the exit_on_error to False for the create_db_user call inside of the create_tethys_db function. This will ensure that both create_db_user calls are executed, whether they are successful or not. To keep the same behavior currently where the create_tethys_db function can exit on an error, I have added a exit_creation_on_error argument to the function. If set to True, then the function will exit if either one of the create_db_user calls fails.
I also updated the logging in the create_tethys_db function to give more details on what user or database is being created
Steps to reproduce
Quality Checks