added badge, has_badge and checkin tables