Ticket #1128 (closed defect: invalid)
Allow for models that have app_label set to a 3rd party library's app name
|Reported by:||berryphillips@…||Owned by:||andrew|
If you have a model with the app_label set to a 3rd party library's app name south will not add migrations for that model. For example:
If you have an app in your project called user_profiles with the following models.py:
from django.db import models from django.contrib.auth.models import User class UserProfile(models.Model): user = models.OneToOneField(User) job_title = models.CharField(max_length=100) class Meta: app_label = 'auth'
When running the initial schemamigration, the migrations folder is created and an initial migration script is added. However, the script is empty. If you comment out the app_label and run the initial schemamigration the migration is created successfully. If you uncomment the app_label and try adding a new field and run an auto schemamigration a migration gets added to remove the model.
If you leave app_label commented out whenever creating migrations but uncomment it when actually executing the migrations the table is created as expected. In this case that would be auth_userprofile.
South should automatically take this into account when generating migrations. I should be able to define the app_label as anything I like and have south generate migrations as expected.