Django 1.7 makemigrations has no effect

I keep running python manage.py makemigrations on my heroku server, but no matter how many times I run it, I get:

 $heroku run python manage.py makemigrations Running `python manage.py makemigrations` attached to terminal... up, run.2680 Migrations for 'default': 0002_auto_20141120_2007.py: - Alter field user on usersocialauth 

and if I run heroku run python manage.py migrate

he returns with:

 Running `python manage.py migrate` attached to terminal... up, run.1285 Operations to perform: Synchronize unmigrated apps: baflist_core, rest_framework, localflavor, storages Apply all migrations: admin, userAccount, contenttypes, sessions, default, location, messaging, forum, auth, posts Synchronizing apps without migrations: Creating tables... Installing custom SQL... Installing indexes... Running migrations: No migrations to apply. Your models have changes that are not yet reflected in a migration, and so won't be applied. Run 'manage.py makemigrations' to make new migrations, and then re-run 'manage.py migrate' to apply them. 

Admittedly, I am fairly aware that postgres and migrations are dangerous, so I decided that I would ask here. Has anyone come across this before?

+6
source share
1 answer

After completing the local migration, you should have a migration file in the <your django app>/migrations Ex folder (restapi is my application for Django):

 /Django/app/folder/restapi/migrations$ ls 0001_initial.py 0001_initial.pyc __init__.py __init__.pyc 

So, you have to transfer the migration file manually:

 heroku$ git commit restapi/migrations/0001_initial.py -m "migrations file" heroku$ git push heroku master 

Note: NO heroku will not automatically start in your application! I checked it out! You must start the migration for your application after clicking on the file:

heroku $ heroku run python manage.py migrate restapi Run python manage.py migrate restapi connected to the terminal ... up, start .4602 Operations to complete: Apply all migrations: restapi Perform migrations: Apply restapi.0001_initial ... OK

+7
source

Source: https://habr.com/ru/post/978479/


All Articles