-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial migration to django management #1481
Initial migration to django management #1481
Conversation
Hello @york-stsci, Thank you for updating ! Cheers ! There are no PEP8 issues in this Pull Request. 🍻 Comment last updated at 2024-02-12 20:29:23 UTC |
@york-stsci - verifying that you ran |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You will need to include the initial migration file (does that go in anew folder?)
Please also include the updated example config file that has the new monitors database setup information in it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything looks okay from a coding perspective. Just a couple of questions from me.
@BradleySappington apparently when you're adding a new database to an existing installation, it uses the existing file for makemigrations, and migrate.py doesn't (yet) create any new migrations for the new database, so there isn't a new migration file to include. This is a slight weirdness with django. More or less every django manage.py command takes the argument |
@york-stsci , just want to be clear. |
1 similar comment
@york-stsci , just want to be clear. |
@york-stsci all of the model files look good. I spoke with @BradleySappington and we can make sure we dissect all of them when we add the monitors one at a time to make sure everything looks good. I approved it, tests are passing, at this point what's next? |
I think the only thing remaining is that @BradleySappington requested a code change, which was updating the example config, which I've now done, but I think he has to approve that I've done it before merging is unlocked. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good with this one question
This PR includes the following:
python manage.py inspectdb --database monitors
to generate themonitor_models.py
filemanaged=False
lines, and re-order the databasespython manage.py migrate --database monitors
to generate an initial migration fileIn addition, I adjusted the config.json file to point django to both its own default databases and the jwqldb database, but have not yet removed any of the other SQL code.
If I understand correctly what's going on here, it should now be possible to access and update the monitor databases either via Django or via SQLAlchemy (where by "update" I mean "add or edit rows" not "change the composition of tables").