diff --git a/djangoplugins/migrations/0002_add_id_to_plugins_uniq.py b/djangoplugins/migrations/0002_add_id_to_plugins_uniq.py new file mode 100644 index 0000000..2bdd5ee --- /dev/null +++ b/djangoplugins/migrations/0002_add_id_to_plugins_uniq.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models +import dirtyfields.dirtyfields + + +class Migration(migrations.Migration): + + dependencies = [ + ('djangoplugins', '0001_initial'), + ] + + operations = [ + migrations.AlterUniqueTogether( + name='plugin', + unique_together=set([('point', 'name', 'id')]), + ), + ] diff --git a/djangoplugins/models.py b/djangoplugins/models.py index d0fbd94..b8cbc01 100644 --- a/djangoplugins/models.py +++ b/djangoplugins/models.py @@ -85,7 +85,7 @@ class Plugin(DirtyFieldsMixin, models.Model): objects = PluginManager() class Meta: - unique_together = (("point", "name"),) + unique_together = (("point", "name", "id"),) ordering = ('index', 'id') def __str__(self):