Skip to content
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

creating anomaly_db_transfer #1214

Merged
merged 4 commits into from
Mar 16, 2023

Conversation

BradleySappington
Copy link
Collaborator

Created transfer script from postgres anomaly database to django models.
Add fields to anomalies model

@BradleySappington
Copy link
Collaborator Author

This script should only need to be run once on production to transfer the existing postgres anomaly database over to models.

This code will need to be run after code to access anomaly information from the model database is implemented

@mfixstsci
Copy link
Collaborator

@BradleySappington sounds good, so if I understand correctly, this will transfer our information gathered in the anomaly table on production over to dev and test?

Copy link
Collaborator

@melanieclarke melanieclarke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me, and I think it will be very helpful to have this info in the models instead of the postgres table.

Spot checks with my local models and the dev db look good on test files with known anomalies look good -- I see the new entries in the Anomalies table and updating them via the app, rerunning the update, and checking again updates them appropriately.

jwql/website/apps/jwql/anomaly_db_transfer.py Show resolved Hide resolved
@BradleySappington
Copy link
Collaborator Author

@BradleySappington sounds good, so if I understand correctly, this will transfer our information gathered in the anomaly table on production over to dev and test?

@mfixstsci we have separate test, dev, and production postgres databases. This will transfer the existing DB information into the related django db. So if we run on Dev (which I did), it will update the dev server models with dev data (not production).

@BradleySappington
Copy link
Collaborator Author

@mfixstsci ready for merge

@BradleySappington
Copy link
Collaborator Author

closes #1187

@BradleySappington
Copy link
Collaborator Author

@mfixstsci SERVER UPDATE AFTER MERGE:
run
$python manage.py makemigrations
$python manage.py migrate
$python anomaly_db_transfer.py

Copy link
Collaborator

@mfixstsci mfixstsci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @BradleySappington

@mfixstsci
Copy link
Collaborator

@BradleySappington with my comments addressed and @melanieclarke's review, I am rebasing and merging. Then I will go ahead and run the commands on the servers!

@mfixstsci mfixstsci merged commit 0bc6963 into spacetelescope:develop Mar 16, 2023
@mfixstsci
Copy link
Collaborator

@BradleySappington I merged the PR and then ran the commands on the develop branch on both production and dev. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

update datamodels with query anomaly information from postgres DB
4 participants