I've seen that happening when calling a callable as one of the keyword 
argument rather than passing the callable itself. Typical example:

class TimeFramedModel(models.Model):
    created = models.DateTimeField(default=timezone.now*()*)

Instead of:

class TimeFramedModel(models.Model):
    created = models.DateTimeField(default=timezone.now)

As Mike pointed out, in the case of a ForeignKey it might be with choices 
maybe?


On Wednesday, 30 November 2016 17:02:59 UTC, Francis Fisher wrote:
>
> Any idea why makemigrations would fail to recognise that a migration has 
> already been generated?
>
> makemigrations.py is a script which calls makemigrations with appropriate 
> django settings. If I run this once, it will generate the initial 
> migration, but every time I run it subsequently, it will regenerate a 
> migration even though nothing has changed in the model. This is with django 
> 1.10.3 and postgres. The field sk that is constantly regenerated is a 
> foreign key relation to an unmanaged database, but I have referred to this 
> in a different app with no bother.
>
> I am using django 1.10.3.
>
> I found a post in this group that had a similar issue with instantiating a 
> class in the model that was missing an implementation for __eq__ but that 
> doesn't apply in this case as I don't instantiate any class in the model 
> file.
>
> Is there any common mistake that leads to this outcome?
>
> ------------------
>
> user@testenv:~/eit/testproj$ ./makemigrations.py 
> Migrations for 'sk':
>   testproj/sk/migrations/0001_initial.py:
>     - Create model SKM
> user@testenv:~/eit/testproj$ ./makemigrations.py 
> Migrations for 'sk':
>   testproj/sk/migrations/0002_auto_20161130_1643.py:
>     - Alter field s on skm
> user@testenv:~/eit/testproj$ 
> user@testenv:~/eit/testproj$ ./makemigrations.py 
> Migrations for 'sk':
>   testproj/sk/migrations/0003_auto_20161130_1643.py:
>     - Alter field s on skm
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/507878c8-a82a-4134-95f3-420699283347%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to