Django makemigrate not recognizing difference between settings.AUTH_USER_MODEL and auth.User

46 views
Skip to first unread message

Siddhartha R T

unread,
Mar 17, 2014, 12:53:50 PM3/17/14
to django...@googlegroups.com
I recently upgraded my Django version to 1.6.2, and I ran into the following problem:

I was extending the auth.AbstractUser class, and I did the following:

    #node/models.py
    class Person(AbstractUser):
        dept = models.ManyToManyField(Department)

    #settings.py
    AUTH_USER_MODEL = node.Person
   
    #one of the other models had a reference to User:
    #node/models.py
    class Page(models.Model):
        ...
        owner = User

Before I changed the Page class, I ran `python manage.py makemigrations` and `python manage.py migrate`,
because I didn't know I had to change User to settings.AUTH_USER_MODEL. Now, the db was edited:

.schema node_page_owner
...
    "user_id" integer NOT NULL,
...

Now I have made the change in Page class to point owner to `settings.AUTH_USER_MODEL`, but a
`python manage.py migrate` doesn't recognize this change, thereby not changing the column name `user_id`. What should I do now?
Reply all
Reply to author
Forward
0 new messages