Exclude missing accounts from contact migration
Otherwise, moveContacts fails with a foreign key constraint violation.
This commit is contained in:
parent
9928e5ffc2
commit
dd208b6e82
1 changed files with 3 additions and 1 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue