So I tried to upgrade my board this morning and got an error:
PG::UniqueViolation: ERROR: duplicate key value violates unique constraint “index_users_on_username”
It names a user “MikeC”. So I did some digging and it advised that I should restore postgres_data and start my board again, then look at the DB for duplicates. So I ran a quick query for username_lower = ‘mikec’ and found 1 row. Then I found this fancy query:
SELECT username_lower, count(*) from users GROUP by username_lower HAVING count(*) > 1;
Which returned no rows. So where is the duplicate? Any help appreciated. I am running on the old data but I would like to be able to rebuild the app properly.