I use Django1.7 with Mezzanine. I create simple profile (according to Mezzanine documentation) stored in separate app \"profiles\":
class RoadmapProfile(mode
'profiles'
from the table 'django_migrations'
.python manage.py makemigrations
and python manage.py migrate
command.In my case I wrote like this:
python manage.py makemigrations
--empty yourappname
python manage.py migrate yourappname
or:
Django keeps track of all the applied migrations in django_migrations table. So just delete all the rows in the django_migrations table that are related to you app like:
DELETE FROM django_migrations WHERE app='
your-app-name'
and then do:
python manage.py makemigrations
python manage.py migrate
This is a very confusing topic. django stores all applied migrations in a table called django_migrations. perform this sql ( i am using postgres . so in query tool section)
select * from django_migrations where app='your appname' (app in which u have issue with).
This will list all applied migrations for that app.
Go to your app/migration folder and check all migrations . find the migration file associated with your error . file where your table was created or column added or modified.
look for the id of this migration file in django_migrations table( select * from django_migrations where app='your app') .
Then do :
delete from django_migrations where id='id of your migration';
delete multiple id's if you have multiple migrations file associated with your issue.
now reapply migrate
Python manage.py migrate yourappname
second option
Drop tables in your app where you have issue.
delete all migrations for that app from app/migrations folder.(don't delete init.py from that folder).
now run
python manage.py makemigrations appname
now run
python manage.py migrate appname