Revert: Grant migrator privileges even when the user already exists#8313
Revert: Grant migrator privileges even when the user already exists#8313CarolineDenis wants to merge 2 commits into
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
combs-a
left a comment
There was a problem hiding this comment.
I wrote these testing instructions, but they may need to be added onto if anyone spots any additional coverage needed!
New database:
- Check the
specify7container logs and make sure there are no migration errors. - Make sure that it's opening the Specify 7 initial database setup screen.
Previously existing database (used pre v7.12):
- Check the
specify7container logs and make sure there are no migration errors. - Make sure that it's opening the Specify 7 login page.
New database worked as expected.

Was able to create a new database with no issues, but ran into an issue with the Specify app user when attempting to open an old database. Used the same database as I did in the originally reported issue.
|
Noting this here--the regex also needs to be checked; there is an issue with not forming the database names correctly. Had a DB with an underscore in it and so it attempted to grant permissions to Not quite in the scope of just this PR but should be fixed. |
… to preexisting appuser
There was a problem hiding this comment.
New database:
- Check the
specify7container logs and make sure there are no migration errors. - Make sure that it's opening the Specify 7 initial database setup screen.
Previously existing database (used pre v7.12):
- Check the
specify7container logs and make sure there are no migration errors. - Make sure that it's opening the Specify 7 login page.
New database works as expected, and as long as I destroy the database volume when rebuilding the containers (docker compose down -v), using an existing database works as well.
If I don't destroy the volume, mariadb will not source the seed-database/*.sql files, and in this case I have to add
CREATE DATABASE IF NOT EXISTS `...`to the start of the .sql file, So I'm not sure if that is the intended behavior. If I omit the -v, then I do have migration errors, because the existing database is not loaded by the mariadb container. If this is intended behavior I can approve.
Fixes #8305
Checklist
self-explanatory (or properly documented)
specify7/specifyweb/specify/management/commands/run_key_migration_functions.py
Line 50 in ea04665
Testing instructions
specify_migrator* andspecify_user* already created in MySQL.MIGRATOR_NAMEandAPP_USER_NAMEin the .env file..envfile so that the DATABASE_NAME is one that does not exist yet.specify7container logs and make sure there are no migration errors..envfile so that the DATABASE_NAME is one that does exist and was not previously opened in v7.12.specify7container logs and make sure there are no migration errors.Additional checks:
.envprints the proper log message..envprints the proper log message..envprints the proper log message.