Fix migrations

The initial migration wasn't right...had to make some fixes. This also includes the badge uniqueness PR.