0

The migration process runs within a docker environment.

After running docker-compose run web python manage.py makemigrations terminal showed

Migrations for 'api_app': api_app/migrations/0004_analysis_error.py

But the file didn't show up in the local directory. I ran docker-compose run web python manage.py migrate and it even showed:

Applying api_app.0004_analysis_error... OK

But still no api_app.0004_analysis_error.py in the local directory.

I also tried making an empty migration, the same behavior occurred. I also tried removing the changes and resetting the migrations, no changes were detected (even though there were).

The application name has been included in the [INSTALLED_APP] module in settings.py.

Anna Huang
  • 287
  • 2
  • 5
  • 15
  • Are you sure the file did not show up there? Maybe if you are using and IDE, it takes some time for it to refresh. Can you confirm that the file is not there even if you open the directory in your OS' file explorer? – Ozgur Akcali Sep 25 '19 at 14:25
  • @OzgurAkcali yes, even in file explorer it didn't show up, also tried `ls` in the terminal for the migrations folder, same thing. I confirm it has init.py – Anna Huang Sep 25 '19 at 14:26

1 Answers1

0

The issue is similar to this: Why am I unable to run django migrations via the 'docker-compose run web' command?

When running docker-compose run it created the migration file in the new container but not copied to local.

To grab the file out of the container: Copying files from Docker container to host

Anna Huang
  • 287
  • 2
  • 5
  • 15