As the title says, I can\'t seem to get migrations working.
The app was originally under 1.6, so I understand that migrations won\'t be there initially, and indeed i
This is kind of a stupid mistake to make, but having an extra comma at the end of the field declaration line in the model class, makes the line have no effect.
It happens when you copy paste the def. from the migration, which itself is defined as an array.
Though maybe this would help someone :-)
Maybe this will help someone. I was using a nested app. project.appname and I actually had project and project.appname in INSTALLED_APPS. Removing project from INSTALLED_APPS allowed the changes to be detected.
Had the same problem Make sure whatever classes you have defined in models.py, you must have to inherit models.Model class.
class Product(models.Model):
title = models.TextField()
description = models.TextField()
price = models.TextField()
python manage.py makemigrations accounts Migrations for 'accounts': accounts\migrations\0001_initial.py - Create model Customer - Create model Tag - Create model Product - Create model Order
Note: here "accounts" is my app name
Following worked for me:
Worked for me: Python 3.4, Django 1.10
My solution was not covered here so I'm posting it. I had been using syncdb
for a project–just to get it up and running. Then when I tried to start using Django migrations, it faked them at first then would say it was 'OK' but nothing was happening to the database.
My solution was to just delete all the migration files for my app, as well as the database records for the app migrations in the django_migrations
table.
Then I just did an initial migration with:
./manage.py makemigrations my_app
followed by:
./manage.py migrate my_app
Now I can make migrations without a problem.