I have a django project built with Django 1.10.7 and mysql 14.14 Distrib 5.5.54
If I do:
$ python manage.py makemigrations my_app
I get:
Migrations for 'my_app':
my_app/migrations/0023_auto_20180301_1419.py:
- Alter field reference on league
Then:
$ python manage.py migrate
Operations to perform:
Apply all migrations: admin, auth, contenttypes, my_app, sessions
Running migrations:
Applying my_app.0023_auto_20180301_1419... OK
Then, just after, I do:
$ python manage.py makemigrations my_app
I get:
Migrations for 'my_app':
my_app/migrations/0024_auto_20180301_1421.py:
- Alter field reference on league
As you can see it is the same alteration as before. It seems that django does not make the migrations well, or does but does not detect anything.
In models.py, the class is as follows:
class League(models.Model):
name = models.CharField(max_length=50)
id_creator = models.ForeignKey('auth.User', on_delete=models.CASCADE)
id_tour = models.ForeignKey('Tour', on_delete=models.CASCADE)
step = models.IntegerField(default=0)
creation_date = models.DateTimeField(default=timezone.now)
reference = models.CharField(max_length=20, default=id_generator())
def __str__(self):
return self.name
What have I done wrong ?