diff --git a/apps/assets/migrations/0050_auto_20200702_1602.py b/apps/assets/migrations/0050_auto_20200702_1602.py new file mode 100644 index 000000000..5471003ae --- /dev/null +++ b/apps/assets/migrations/0050_auto_20200702_1602.py @@ -0,0 +1,22 @@ +# Generated by Django 2.2.10 on 2020-07-02 08:02 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('assets', '0049_systemuser_sftp_root'), + ] + + operations = [ + migrations.AlterField( + model_name='domain', + name='name', + field=models.CharField(max_length=128, verbose_name='Name'), + ), + migrations.AlterUniqueTogether( + name='domain', + unique_together={('org_id', 'name')}, + ), + ] diff --git a/apps/assets/models/domain.py b/apps/assets/models/domain.py index 2f4cc82b3..296e4cd18 100644 --- a/apps/assets/models/domain.py +++ b/apps/assets/models/domain.py @@ -17,13 +17,14 @@ __all__ = ['Domain', 'Gateway'] class Domain(OrgModelMixin): id = models.UUIDField(default=uuid.uuid4, primary_key=True) - name = models.CharField(max_length=128, unique=True, verbose_name=_('Name')) + name = models.CharField(max_length=128, verbose_name=_('Name')) comment = models.TextField(blank=True, verbose_name=_('Comment')) date_created = models.DateTimeField(auto_now_add=True, null=True, verbose_name=_('Date created')) class Meta: verbose_name = _("Domain") + unique_together = [('org_id', 'name')] def __str__(self): return self.name