-
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.
* Add 'pipeline_version' to SequenceEntriesView * Add 'pipelineVersion' to RawProcessedData * Add 'pipelineVersion' to get-released-data return values * Add 'pipelineVersion' to _common-metadata.tpl * Test fix * Add missing comma * Update schema documentation based on migration changes * trigger preview * fixes * Update schema documentation based on migration changes * trigger preview --------- Co-authored-by: GitHub Action <action@github.com>
- Loading branch information
1 parent
3c6510b
commit ee6ec02
Showing
8 changed files
with
61 additions
and
1 deletion.
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
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
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
41 changes: 41 additions & 0 deletions
41
...c/main/resources/db/migration/V1.9__update_sequence_entries_view_add_pipeline_version.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,41 @@ | ||
drop view if exists sequence_entries_view; | ||
|
||
create view sequence_entries_view as | ||
select | ||
se.*, | ||
sepd.started_processing_at, | ||
sepd.finished_processing_at, | ||
sepd.processed_data as processed_data, | ||
sepd.processed_data || em.joint_metadata as joint_metadata, | ||
case | ||
when se.is_revocation then (select version from current_processing_pipeline) | ||
else sepd.pipeline_version | ||
end as pipeline_version, | ||
sepd.errors, | ||
sepd.warnings, | ||
case | ||
when se.released_at is not null then 'APPROVED_FOR_RELEASE' | ||
when se.is_revocation then 'PROCESSED' | ||
when sepd.processing_status = 'IN_PROCESSING' then 'IN_PROCESSING' | ||
when sepd.processing_status = 'PROCESSED' then 'PROCESSED' | ||
else 'RECEIVED' | ||
end as status, | ||
case | ||
when sepd.processing_status = 'IN_PROCESSING' then null | ||
when sepd.errors is not null and jsonb_array_length(sepd.errors) > 0 then 'HAS_ERRORS' | ||
when sepd.warnings is not null and jsonb_array_length(sepd.warnings) > 0 then 'HAS_WARNINGS' | ||
else 'NO_ISSUES' | ||
end as processing_result | ||
from | ||
sequence_entries se | ||
left join sequence_entries_preprocessed_data sepd on | ||
se.accession = sepd.accession | ||
and se.version = sepd.version | ||
and sepd.pipeline_version = (select version from current_processing_pipeline) | ||
left join external_metadata_view em on | ||
se.accession = em.accession | ||
and se.version = em.version; | ||
|
||
update sequence_entries_preprocessed_data | ||
set processing_status = 'PROCESSED' | ||
where processing_status in ('HAS_ERRORS', 'FINISHED'); |
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
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