Fixed migrations bug for postgres