diff --git a/backend/spellbook/migrations/0010_feature_name_unique_ci.py b/backend/spellbook/migrations/0010_feature_name_unique_ci.py index 8250e998..e57eff2d 100644 --- a/backend/spellbook/migrations/0010_feature_name_unique_ci.py +++ b/backend/spellbook/migrations/0010_feature_name_unique_ci.py @@ -1,4 +1,4 @@ -# Generated by Django 4.2.1 on 2023-07-04 09:05 +# Generated by Django 4.2.1 on 2023-07-04 09:42 from django.db import migrations, models import django.db.models.functions.text @@ -13,6 +13,6 @@ class Migration(migrations.Migration): operations = [ migrations.AddConstraint( model_name='feature', - constraint=models.UniqueConstraint(django.db.models.functions.text.Lower('name'), name='name_unique_ci'), + constraint=models.UniqueConstraint(django.db.models.functions.text.Lower('name'), name='name_unique_ci', violation_error_message='Feature name should be unique, ignoring case.'), ), ] diff --git a/backend/spellbook/models/feature.py b/backend/spellbook/models/feature.py index c415bd2e..f0bdd4ea 100644 --- a/backend/spellbook/models/feature.py +++ b/backend/spellbook/models/feature.py @@ -17,7 +17,8 @@ class Meta: constraints = [ models.UniqueConstraint( Lower('name'), - name='name_unique_ci' + name='name_unique_ci', + violation_error_message='Feature name should be unique, ignoring case.', ), ]