Skip to content

Commit

Permalink
Simplified the constraint for unique templates to only the template n…
Browse files Browse the repository at this point in the history
…ame since that is what templates are referenced by
  • Loading branch information
christophertubbs committed Nov 2, 2023
1 parent dccc377 commit 4a46030
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 7 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"""
Provides custom CLI commands for the evaluation service
"""
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Generated by Django 4.2.5 on 2023-11-01 20:28

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('evaluation_service', '0006_specificationtemplate_template_last_modified'),
]

operations = [
migrations.RemoveConstraint(
model_name='specificationtemplate',
name='unique_template_idx',
),
migrations.AddConstraint(
model_name='specificationtemplate',
constraint=models.UniqueConstraint(fields=('template_name',), name='unique_template_idx'),
),
]
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
class SpecificationTemplate(models.Model):
class Meta:
constraints = [
UniqueConstraint(name="unique_template_idx", fields=["author", "template_name", "template_specification_type"])
UniqueConstraint(name="unique_template_idx", fields=["template_name"])
]

template_name = models.CharField(verbose_name="name", max_length=100, help_text="The name of the template")
Expand Down

0 comments on commit 4a46030

Please sign in to comment.