Skip to content

Commit

Permalink
Properly gather list items to update itemID's for if list items don't…
Browse files Browse the repository at this point in the history
… have multiple values #23 (#33)
  • Loading branch information
johnatawnclementawn authored Sep 16, 2024
1 parent 032a84b commit f36068e
Showing 1 changed file with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -296,12 +296,19 @@ class Migration(migrations.Migration):
where t.list_item_id = n.legacy_list_item_id
and rownumber > 1;
-- Update list_item_ids for items that don't have multiple values
update temp_list_items_and_values
set list_item_id = uuid_generate_v4()
where rownumber > 1
and legacy_conceptid != any(listitems_to_update_with_multiple_values)
and list_item_id = legacy_conceptid;
-- Update list_item_ids for items that don't have multiple values (like prefLabel)
if array_length(listitems_to_update_with_multiple_values, 1) > 0 then
update temp_list_items_and_values
set list_item_id = uuid_generate_v4()
where rownumber > 1
and legacy_conceptid != any(listitems_to_update_with_multiple_values)
and list_item_id = legacy_conceptid;
else
update temp_list_items_and_values
set list_item_id = uuid_generate_v4()
where rownumber > 1
and list_item_id = legacy_conceptid;
end if;
-- Update listitemvalue_ids
update temp_list_items_and_values
Expand Down

0 comments on commit f36068e

Please sign in to comment.