Merge branch 'exclude-missing-accounts' into 'main'

Exclude missing accounts from contact migration

See merge request 
This commit is contained in:
Andrew Ferrazzutti 2022-08-12 20:47:01 +00:00
commit 8649064ce1

View file

@ -614,7 +614,9 @@ func moveGroupCredentials(source *sql.DB, dest *sql.DB) error {
}
func moveContacts(source *sql.DB, dest *sql.DB) error {
rows, err := source.Query("SELECT account_uuid, recipient, name, color, profile_key, message_expiration_time, inbox_position FROM contacts")
rows, err := source.Query("SELECT account_uuid, recipient, name, color, profile_key, message_expiration_time, inbox_position FROM contacts" +
" WHERE account_uuid IN (SELECT DISTINCT uuid FROM accounts)",
)
if err != nil {
return err
}