Skip to content

Commit

Permalink
Constraint on null cost centres
Browse files Browse the repository at this point in the history
  • Loading branch information
CaitBarnard committed Dec 10, 2024
1 parent ec69ac4 commit 920805d
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
26 changes: 26 additions & 0 deletions core/migrations/0019_remove_attrition_unique_attrition_and_more.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Generated by Django 5.1.3 on 2024-12-10 15:04

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("core", "0018_alter_attrition_cost_centre_and_more"),
("costcentre", "0008_alter_simplehistoryarchivedcostcentre_options_and_more"),
]

operations = [
migrations.RemoveConstraint(
model_name="attrition",
name="unique_attrition",
),
migrations.AddConstraint(
model_name="attrition",
constraint=models.UniqueConstraint(
fields=("financial_year", "cost_centre"),
name="unique_attrition",
nulls_distinct=False,
),
),
]
1 change: 1 addition & 0 deletions core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ class Meta:
"financial_year",
"cost_centre",
],
nulls_distinct=False,
name="unique_attrition",
),
)
Expand Down

0 comments on commit 920805d

Please sign in to comment.