Support stupid mysql 5.5, fix copying published badges