
I ran this query from the "sqlite3" CLI:
SELECT email FROM account_emailaddress GROUP BY lower(email) HAVING COUNT(*) > 1
And to inspect the differences:
SELECT * FROM account_emailaddress WHERE lower(email) IN( SELECT lower(email) FROM account_emailaddress GROUP BY lower(email) HAVING COUNT(*) > 1) ORDER BY email;
".schema account_emailaddress" did show the table structure
Check all the data:
SELECT "id", "verified", "primary", "user_id", "auth_user", "email" FROM account_emailaddress WHERE lower(email) IN( SELECT lower(email) FROM account_emailaddress GROUP BY lower(email) HAVING COUNT(*) > 1) ORDER BY lower(email);
Clean the non lower case accounts found: DELETE FROM account_emailaddress WHERE id IN (xxx,xxx,xxx,xxx);
Then apt dist-upgrade could finish it's work.