Added constraint existence check in postgres migration