V5 Test Migration results and bugs

@david

Checked the client_contacts table:

is_primary is set to 0 on the ones that don’t show up in the table,
it is set to 1 on the ones we edited and saved, so that is the issue, I’m guessing that value does not exist in v4 or does not get mapped during migration?

I’m guessing changing them directly in the table is a bad idea as multiple contacts can get assigned as primary for the same company.

Any way of doing it through tinker with a sanity check just selecting 1 per company, can base selection on the contact creation date that has transferred from v4 and is in the same table, (i.e. set first user created as company primary contact.)

Of course would be better if this is set during migration if any info is stored in v4.

@david
Just checked the contacts table in v4,

is_primary column is there and is set correctly.


Client::with('contacts')->cursor()->each(function ($client){

  $contact = $client->contacts->first();
  $contact->is_primary = true;
  $contact->save();
  
});

This should be accounted for in the migration, unsure why they are not carrying across.

1 Like

Thanks for that, worked perfectly!!!