look this:
(venv) backend > heroku run ./manage.py makemigrations blog
› Warning: heroku update available from 7.19.4 to 7.26.2
Running ./manage.py makemigrations blog on ⬢ webstation... up, run.1553 (Free)
Migrations for 'blog':
blog/migrations/0001_initial.py
- Create model BlogPage
- Create model BlogPageTag
- Create model BlogPageViews
- Add field tags to blogpage
and
(venv) backend > heroku run ls blog
› Warning: heroku update available from 7.19.4 to 7.26.2
Running ls blog on ⬢ webstation... up, run.4984 (Free)
admin.py apps.py code_block.py __init__.py models.py __pycache__ tests.py views.py wagtail_hooks.py
first, says that the migration was created, and I have a migrations directory inside the blog, second, the "migrations" directory does not exist.
I've run "makemigrations" several times, and always runs this, but the directory is never created.
This is expected behaviour. Heroku has an ephemeral filesystem - any files created during dyno operation are deleted when the dyno restarts (which on a free dyno is every time you reconnect to it). This is what you're seeing - every time you reconnect to the dyno your files are deleted.
You should not be trying to make migrations on heroku. You need to make those migrations locally, commit them, and then push these migrations to heroku's git repository.
Then you can run the migrations on heroku because the files will persist.
Similarly all other files that you need to persist on the dyno need to be committed in your repo (or compiled within the buildpack).