-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(backend): add foreign key to delete preprocessed data (#3259)
Co-authored-by: Anna (Anya) Parker <[email protected]> Co-authored-by: Cornelius Roemer <[email protected]>
- Loading branch information
1 parent
a223017
commit 2bcaf48
Showing
4 changed files
with
64 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
.../main/resources/db/migration/V1.6__add_sequence_entries_preprocessed_data_foreign_key.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
delete from sequence_entries_preprocessed_data sepd | ||
where | ||
not exists( | ||
select | ||
from sequence_entries se | ||
where | ||
se.accession = sepd.accession | ||
and se.version = sepd.version | ||
); | ||
|
||
alter table sequence_entries_preprocessed_data | ||
add constraint sequence_entries_preprocessed_data_accession_version_fkey foreign key (accession, version) | ||
references sequence_entries on update cascade on delete cascade; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters