← Back to Upcase

Migrate Status on Heroku


(Chris Kuffo) #1

I am having a problem with my app on Heroku.

When I run

heroku run rake db:migrate:status

it shows 5 of my migrations with only 2 of them saying up status and the other 3 three say down status.

How do i get the other three to be up. I ran

heroku run rake db:migrate

what step am i missing?

Thanks.


(Jon Seidel) #2

Any errors when you ran the rake db:migrate? That should have complained if there was a problem.


(Chris Kuffo) #3

your right it says
PG::Error: ERROR: column “first_name” of relation “users” already exists
: ALTER TABLE “users” ADD COLUMN “first_name” character varying(255)
rake aborted!
An error has occurred, this and all later migrations canceled:

Im not sure what i did wrong everything seems to work well locally and i was just pushing the code to heroku. Should i be doing something else to the data on heroku?


(Chris Kuffo) #4

This resolved my problem

heroku run rake db:setup

Then

heroku run rake db:migrate:reset

Finally my migrate passes

heroku run rake db:migrate

Then i restarted heroku

heroku restart

My app works as normal