В Хероку данные внутри контейнера хранятся до перезапуска.
Нужно использовать другие СУБД, предоставляемые как addons.
You can write to it, and you can read from it, but the contents will be cleared periodically. If you were to use SQLite on Heroku, you would lose your entire database at least once every 24 hours.
Dynos are also restarted (cycled) at least once per day to help maintain the health of applications running on Heroku. Any changes to the local filesystem will be deleted. The cycling happens once every 24 hours (plus up to 216 random minutes, to prevent every dyno for an application from restarting at the same time).
The Dyno Manager restarts your dyno(s) when:
you create a new release by deploying new code
change your config vars
changing your add-ons
when you run heroku restart
heroku keys:add
heroku keys
ssh -v git@heroku.com
heroku run rake db:rollback