Skip to content

Commit

Permalink
add migration
Browse files Browse the repository at this point in the history
  • Loading branch information
anna-parker committed Dec 6, 2024
1 parent 9398476 commit e6ef403
Showing 1 changed file with 55 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
update sequence_entries_preprocessed_data
set warnings = (
select json_agg(
json_build_object(
'unprocessedFields', (
select json_agg(
json_build_object(
'name', source->>'name',
'type', source->>'type'
)
)
from json_array_elements(warning->'source') as source
),
'processedFields', (
select json_agg(
json_build_object(
'name', source->>'name',
'type', source->>'type'
)
)
from json_array_elements(warning->'source') as source
),
'message', warning->>'message'
)
)
from json_array_elements(warnings) as warning
)
where warnings is not null;
set errors = (
select json_agg(
json_build_object(
'unprocessedFields', (
select json_agg(
json_build_object(
'name', source->>'name',
'type', source->>'type'
)
)
from json_array_elements(error->'source') as source
),
'processedFields', (
select json_agg(
json_build_object(
'name', source->>'name',
'type', source->>'type'
)
)
from json_array_elements(error->'source') as source
),
'message', error->>'message'
)
)
from json_array_elements(errors) as error
)
where errors is not null;

0 comments on commit e6ef403

Please sign in to comment.