Monday, May 29, 2017

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

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.

--
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+unsubscribe@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/33c79098-93f2-4b5e-afb2-b29f74f0dd38%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment