Skip to content

Fix phone number updates in import script

Jeff May requested to merge jeff/fix-import-script into dev

@DSASanFrancisco/portal-members

Prior to this change, if the import script failed before everything finished, the member would be left in a state where they would have no phone_numbers or identities records. The script would then refuse to update the identities or phone numbers of already existing members.

This change just makes the script attempt to update the phone numbers and identities of existing members. It might add a duplicate phone number at times (the unique index only applies when the two phone numbers have the same format), but most of the time, it will hit the unique index, ignore the error, and move on. I believe this is the behavior we want.

In the future, I believe we may want to cancel the entire transaction if any part of it fails. I didn't want to try and make that change just yet because I was having issues with timeouts, and I'm not sure that doing everything in a single transaction is safe just yet.

Merge request reports