-
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.
feat(website, backend, prepro)!: Update error schema with input and o…
…utput metadata field names (#3348) * Update specification.md * Update nextclade prepro pipeline to include input and output metadata fields * add DB migration * update dummy pipeline to include input and output metadata fields --------- Co-authored-by: Theo Sanderson <[email protected]>
- Loading branch information
1 parent
9323a18
commit 3c6510b
Showing
19 changed files
with
590 additions
and
226 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
67 changes: 67 additions & 0 deletions
67
backend/src/main/resources/db/migration/V1.8__update_error_schema.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,67 @@ | ||
update sequence_entries_preprocessed_data | ||
set warnings = ( | ||
select jsonb_agg( | ||
jsonb_build_object( | ||
'unprocessedFields', ( | ||
select jsonb_agg( | ||
jsonb_build_object( | ||
'name', source->>'name', | ||
'type', source->>'type' | ||
) | ||
) | ||
from jsonb_array_elements(warning->'source') as source | ||
), | ||
'processedFields', ( | ||
select jsonb_agg( | ||
jsonb_build_object( | ||
'name', source->>'name', | ||
'type', source->>'type' | ||
) | ||
) | ||
from jsonb_array_elements(warning->'source') as source | ||
), | ||
'message', warning->>'message' | ||
) | ||
) | ||
from jsonb_array_elements(warnings) as warning | ||
) | ||
where warnings is not null | ||
and exists ( | ||
select 1 | ||
from jsonb_array_elements(warnings) as warning | ||
where warning->'source' is not null | ||
); | ||
|
||
update sequence_entries_preprocessed_data | ||
set errors = ( | ||
select jsonb_agg( | ||
jsonb_build_object( | ||
'unprocessedFields', ( | ||
select jsonb_agg( | ||
jsonb_build_object( | ||
'name', source->>'name', | ||
'type', source->>'type' | ||
) | ||
) | ||
from jsonb_array_elements(error->'source') as source | ||
), | ||
'processedFields', ( | ||
select jsonb_agg( | ||
jsonb_build_object( | ||
'name', source->>'name', | ||
'type', source->>'type' | ||
) | ||
) | ||
from jsonb_array_elements(error->'source') as source | ||
), | ||
'message', error->>'message' | ||
) | ||
) | ||
from jsonb_array_elements(errors) as error | ||
) | ||
where errors is not null | ||
and exists ( | ||
select 1 | ||
from jsonb_array_elements(errors) as error | ||
where error->'source' is not null | ||
); |
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
Oops, something went wrong.