diff --git a/seed/migrations/0211_auto_20240109_1348.py b/seed/migrations/0211_auto_20240109_1348.py new file mode 100644 index 0000000000..ad0266c223 --- /dev/null +++ b/seed/migrations/0211_auto_20240109_1348.py @@ -0,0 +1,21 @@ +# Generated by Django 3.2.23 on 2024-01-09 21:48 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('seed', '0210_natural_sort'), + ] + + operations = [ + migrations.RemoveConstraint( + model_name='derivedcolumn', + name='unique_name_for_organization', + ), + migrations.AddConstraint( + model_name='derivedcolumn', + constraint=models.UniqueConstraint(fields=('organization', 'name', 'inventory_type'), name='unique_name_for_organization'), + ), + ] diff --git a/seed/models/derived_columns.py b/seed/models/derived_columns.py index 86c92f729c..598ffa6d67 100644 --- a/seed/models/derived_columns.py +++ b/seed/models/derived_columns.py @@ -202,7 +202,7 @@ class DerivedColumn(models.Model): class Meta: constraints = [ models.UniqueConstraint( - fields=['organization', 'name'], name='unique_name_for_organization' + fields=['organization', 'name', 'inventory_type'], name='unique_name_for_organization' ) ]