Add test for migrations on mysql/postgres
Fix postgres migration issues