Update previous migration, updating the uniqueness parameters. To re-run the previous migration, first do evennia migrate --fake 0006, then run evennia migrate again.

This commit is contained in:
Griatch 2017-01-26 09:22:47 +01:00
parent 05b2d74cee
commit b6a4997a97
2 changed files with 13 additions and 3 deletions

View file

@ -70,5 +70,15 @@ class Migration(migrations.Migration):
]
operations = [
migrations.RunPython(update_tags_with_dbmodel)
migrations.AlterUniqueTogether(
name='tag',
unique_together=set([('db_key', 'db_category', 'db_tagtype', 'db_model')]),
),
migrations.AlterIndexTogether(
name='tag',
index_together=set([('db_key', 'db_category', 'db_tagtype', 'db_model')]),
),
migrations.RunPython(update_tags_with_dbmodel)
]

View file

@ -61,8 +61,8 @@ class Tag(models.Model):
class Meta(object):
"Define Django meta options"
verbose_name = "Tag"
unique_together = (('db_key', 'db_category', 'db_tagtype'),)
index_together = (('db_key', 'db_category', 'db_tagtype'),)
unique_together = (('db_key', 'db_category', 'db_tagtype', 'db_model'),)
index_together = (('db_key', 'db_category', 'db_tagtype', 'db_model'),)
def __unicode__(self):
return u"<Tag: %s%s>" % (self.db_key, "(category:%s)" % self.db_category if self.db_category else "")