Bug? makemigrations doesn't recognize table names generated by metaclasses

11 views
Skip to first unread message

Wolph

unread,
May 29, 2017, 8:54:51 AM5/29/17
to Django users
Hi guys,

It seems that I may have stumbled upon a bug or at the very least, strange behaviour.

For easier reading in the database I use the following table name structure: spam_eggs_foo_bar for an app called spam and a model called EggsFooBar, these names are automatically generated using the following metaclass: https://github.com/WoLpH/django-utils/blob/c596a4d68319cfc4bbc7f4975074323e3935d6c9/django_utils/base_models.py#L20-L29

Now... when I run "migrate --run-syncdb" it creates the tables with the correct names without an issue.
However, if I create the tables using "makemigrations app" followed by "migrate app" it ignores the altered table name.

Note that when manually setting the table using "class Meta:" it does work.
Reply all
Reply to author
Forward
0 new messages