Fix db migrate bug