On Fri, Sep 11, 2015 at 10:37 AM, John Emmatty <[email protected]>
wrote:

> I ran makemigrations against my legacy, MySQL database and it created
> models.py file for me, I copied the file to my applications package
> directory and ran makemigrations again after adding a table to extend the
> default users table. Now makemigrations is throwing following errors . I
> created a fresh django project which had no reference to older versions.
>
>
Are you sure that 'makemigrations' created a models.py file for you? It
should only create migration files, something like 0003_auto.py?

Did you apply the original migration before adding the new table and new
migration? I'm wondering if makemigrations is expecting/assuming that your
DB schema is up to date? Sounds like it wasn't. A quick look through the
migration docs didn't reveal an easy answer.

I'm no migration expert, but I would make sure the DB schema matched the
latest migration before making further changes/migrations.



> SystemCheckError: System check identified some issues:
>
>     ERRORS:
>     djangogettrix.AuthGroupPermissions: (models.E012) 'unique_together'
> refers to the non-existent field 'group_id'.
>     djangogettrix.AuthGroupPermissions: (models.E012) 'unique_together'
> refers to the non-existent field 'permission_id'.
>     djangogettrix.AuthPermission: (models.E012) 'unique_together' refers
> to the non-existent field 'content_type_id'.
>     djangogettrix.AuthUserGroups: (models.E012) 'unique_together' refers
> to the non-existent field 'group_id'.
>     djangogettrix.AuthUserGroups: (models.E012) 'unique_together' refers
> to the non-existent field 'user_id'.
>     djangogettrix.AuthUserUserPermissions: (models.E012) 'unique_together'
> refers to the non-existent field 'permission_id'.
>     djangogettrix.AuthUserUserPermissions: (models.E012) 'unique_together'
> refers to the non-existent field 'user_id'.
>     djangogettrix.RolesUsers: (models.E012) 'unique_together' refers to
> the non-existent field 'role_id'.
>     djangogettrix.RolesUsers: (models.E012) 'unique_together' refers to
> the non-existent field 'user_id'.
>
>
Sounds like tables are missing that makemigrations is expecting to be
present, which would lend a small amount of credibility to my theory above.

Again, I don't have nearly enough experience with complicated migration
scenario's to give you a definitive answer, though.

-James

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2Be%2BciW_aFnX4EkmfteZh-KMRVdm0Vu6vNQFsE3tJb4xVRyHVQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to