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

Creates new table that tracks the test results reported per disease in an upload #6886

Merged

Conversation

johanna-skylight
Copy link
Contributor

@johanna-skylight johanna-skylight commented Oct 30, 2023

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 and Submission pages way too tangled. Moving the count per disease into a different table will allow us to keep the code cleaner.

Testing

  • Verify that the new table gets created and the supported_disease_id columns is removed from upload table.
  • This has been deployed in dev2. Changes are available in dev2 metabase.

@johanna-skylight johanna-skylight changed the title Added db changes to create new table that tracks diseases reported wi… Creates new table that tracks the test results reported per disease in an upload Oct 30, 2023
@johanna-skylight
Copy link
Contributor Author

@mehansen let me know if the table name and columns look good!

@johanna-skylight johanna-skylight temporarily deployed to dev2 October 30, 2023 20:19 — with GitHub Actions Inactive
@johanna-skylight johanna-skylight temporarily deployed to dev2 October 30, 2023 20:28 — with GitHub Actions Inactive
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

Copy link
Contributor

@BobanL BobanL left a 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.

Copy link
Collaborator

@emyl3 emyl3 left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Collaborator

@mehansen mehansen left a 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!

@johanna-skylight johanna-skylight added this pull request to the merge queue Nov 1, 2023
Merged via the queue into main with commit 342ba29 Nov 1, 2023
36 checks passed
@johanna-skylight johanna-skylight deleted the johanna/6723_creates_new_table_upload_disease_details branch November 1, 2023 13:19
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.

4 participants