-
Notifications
You must be signed in to change notification settings - Fork 55
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
Creates new table that tracks the test results reported per disease in an upload #6886
Creates new table that tracks the test results reported per disease in an upload #6886
Conversation
@mehansen let me know if the table name and columns look good! |
Kudos, SonarCloud Quality Gate passed! |
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.
Changes look good! Ran it locally and rollback works as expected
Ran this
./gradlew liquibaseRollbackSql -PliquibaseCommandValue="add-disease_and_destination-columns-to-upload"
, and it generated this sql
ALTER TABLE simple_report.upload ADD supported_disease_id UUID;
ALTER TABLE simple_report.upload ADD CONSTRAINT fk__upload__supported_disease_id FOREIGN KEY (supported_disease_id) REFERENCES simple_report.supported_disease (internal_id);
COMMENT ON COLUMN simple_report.upload.supported_disease_id IS 'The disease that was reported.';
DROP TABLE simple_report.upload_disease_details;
DELETE FROM simple_report.databasechangelog WHERE ID = 'create-upload_disease_details-table' AND AUTHOR = '[email protected]' AND FILENAME = 'classpath:/db/changelog/db.changelog-master.yaml';
Also if anyone is curious, if you include any rollback none of the auto rollbacks will work. I was wondering and couldn't find it online.
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.
LGTM!
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.
table and column names look good thank you!
DATABASE PULL REQUEST
Related Issue
Implements db changes to create new table
upload_disease_details
that will keep the information of the numbers of records per disease reported in an upload.Changes Proposed
Remove the
supported_disease_id
column from the upload table.Create a new table
upload_disease_details
that correlates uploads and diseases plus the count of results reported.Additional Information
The changes to store the count per disease in the upload table (that had as a side effect the duplication of data in the rows) was making the code to support the
Submissions
andSubmission
pages way too tangled. Moving the count per disease into a different table will allow us to keep the code cleaner.Testing