Skip to content

Commit

Permalink
Creates new table that tracks the test results reported per disease i…
Browse files Browse the repository at this point in the history
…n an upload (#6886)

* Added db changes to create new table that tracks diseases reported with the uploader.

* Solved merge conflicts
  • Loading branch information
johanna-skylight authored Nov 1, 2023
1 parent 032789e commit 342ba29
Showing 1 changed file with 89 additions and 1 deletion.
90 changes: 89 additions & 1 deletion backend/src/main/resources/db/changelog/db.changelog-master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5129,4 +5129,92 @@ databaseChangeLog:
tableName: upload
columnName: supported_disease_id
sql: |
DROP TYPE ${database.defaultSchemaName}.PIPELINE CASCADE;
DROP TYPE ${database.defaultSchemaName}.PIPELINE CASCADE;
- changeSet:
id: create-upload_disease_details-table
author: [email protected]
comment: creates upload_disease_details table and drops the disease_id column from upload table
changes:
- tagDatabase:
tag: create-upload_disease_details-table
- dropColumn:
tableName: upload
columnName: supported_disease_id
- createTable:
tableName: upload_disease_details
remarks: contains details of each of the diseases reported in the bulk upload.
columns:
- column:
name: internal_id
type: uuid
remarks: The internal database identifier for this entity.
constraints:
primaryKey: true
nullable: false
- column:
name: upload_id
remarks: the upload internal id.
type: uuid
constraints:
nullable: false
foreignKeyName: fk__upload_disease_details__upload
references: upload
- column:
name: supported_disease_id
remarks: The supported disease reported in the upload.
type: uuid
constraints:
nullable: false
foreignKeyName: fk__upload_disease_details__supported_disease
references: supported_disease
- column:
name: records_count
remarks: The number of records uploaded for the disease.
type: int
constraints:
nullable: false
- column:
name: created_at
type: DATETIME
remarks: The creation timestamp for this entity.
constraints:
nullable: false
- column:
name: created_by
type: uuid
remarks: The user who created this entity.
constraints:
nullable: false
foreignKeyName: fk__anyentity__created_by
references: api_user
- column:
name: updated_at
type: DATETIME
remarks: The timestamp for the most recent update of this entity.
constraints:
nullable: false
- column:
name: updated_by
type: uuid
remarks: The user who most recently updated this entity.
constraints:
nullable: false
references: api_user
foreignKeyName: fk__anyentity__updated_by
- sql: |
GRANT SELECT ON ${database.defaultSchemaName}.upload_disease_details TO ${noPhiUsername};
rollback:
- addColumn:
tableName: upload
columns:
- column:
name: supported_disease_id
remarks: The disease that was reported.
type: uuid
constraints:
nullable: true
foreignKeyName: fk__upload__supported_disease_id
referencedTableName: supported_disease
referencedColumnNames: internal_id
- dropTable:
tableName: upload_disease_details

0 comments on commit 342ba29

Please sign in to comment.