views:

28

answers:

1

Hello,

Heroku doesn't seem to update my database schema when I deploy. Here are the details:

Here is what is should look like for the User class:

create_table "users", :force => true do |t|
t.string   "username"
t.datetime "created_at"
t.datetime "updated_at"
t.string   "email"
t.string   "encrypted_password"
t.string   "salt"
t.string   "remember_token"
t.boolean  "admin",              :default => false

end

Here is my deploy procedure:

git push heroku master
heroku rake db:migrate
heroku db:push

Everything seems to go smoothly... except that if I check the actually User table in db...

heroku console User

... I get an old version of User...

User(id: integer, username: string, created_at: datetime, updated_at: datetime)

Any idea what I am doing wrong? Thanks a lot for your help!

Simon

A: 

Do you see any output when you heroku rake db:migrate?

Try running heroku restart after you migrate to restart the web servers and DJ workers. That shouldn't influence your console, but I have seen web servers serving old versions of the code immediately after a deploy, which normally isn't a problem but with pending migrations can be.

tfe
Thanks tfe, it seems it was a temporary problem. It is working just fine now. I guess a restart would have solve the problem too.
Simon