Reputation: 861
Every time I run the git push
after modifying some codes and try to display app, the following no such table
error appeared.
stdout.log (production environment)
Started GET "/" for 111.222.333.444 at 2014-11-13 22:07:36 +0900
Processing by ArticlesController#index as HTML
SQLite3::SQLException: no such table: articles: SELECT "articles".* FROM "articles" ORDER BY created_at DESC LIMIT 10
Completed 500 Internal Server Error in 16ms
ActiveRecord::StatementInvalid (SQLite3::SQLException: no such table: articles: SELECT "articles".* FROM "articles" ORDER BY created_at DESC LIMIT 10):
app/controllers/articles_controller.rb:7:in `index'
The procedure I did is described below.
rake aseets:precompile
git add .
git commit -m "xxx"
git checkout master
git merge xxx #branch name
git push origin master
I execute the following commands at a hosting service (not heroku) because the error message mentioned above were displayed.
rake db:migrate
rake db:seed
Does it means that all the data stored was cleaned every time I execute git push
?
Please advise me on how to keep the data if I run git push.
Upvotes: 0
Views: 108
Reputation: 136967
Like most PaaS providers, Heroku does not provide a persistent filesystem. Each time you deploy, any files that you have stored locally will be lost.
The general recommendation for file storage on Heroku is to use something like Amazon S3, which will let you store files across deploys. But if you can get away from SQLite, you should consider simply migrating to PostgreSQL, which is natively supported by Heroku, or another database by using one of the supported data storage addons.
Upvotes: 3