Hacker News new | ask | show | jobs
by pindi 4864 days ago
When defining our initial data schema, we forgot to put a unique constraint on user email addresses. There ended up being quite a few duplicates, so before we added the constraint I had to write a query to remove the duplicate users. About 2/3 of our users didn't have an email listed, and my query failed to take that into account, so it wiped out all but one of those users.
1 comments

I have also done this exact thing. Luckily, it was on a development database, so nobody ever had to know! Easy mistake to make, for sure.