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
Heroku Redis is an in-memory, key-value data store and is not meant for long-term data persistence. After your organization deletes data stored in Heroku Redis, it initiates the data deletion process for any Heroku Redis database snapshots that Heroku Services created.
The most recent major PostgreSQL version supported by Heroku is 14. If you want to upgrade your database's minor version, or if you only want to change your Postgres plan or underlying infrastructure, see Changing the Plan or Infrastructure of a Heroku Postgres Database.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With