-
Notifications
You must be signed in to change notification settings - Fork 340
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update unique_bed_name_per_location to ignore deleted beds (#2432)
update unique_bed_name_per_location to ignore deleted beds (#2432) --------- Co-authored-by: vigneshhari <vichuhari100@gmail.com>
- Loading branch information
1 parent
d36b5d9
commit 0683faa
Showing
3 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
care/facility/migrations/0459_remove_bed_unique_bed_name_per_location_and_more.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Generated by Django 4.2.10 on 2024-09-19 14:44 | ||
|
||
import django.db.models.functions.text | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("facility", "0458_facilityflag_facilityflag_unique_facility_flag"), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveConstraint( | ||
model_name="bed", | ||
name="unique_bed_name_per_location", | ||
), | ||
migrations.AddConstraint( | ||
model_name="bed", | ||
constraint=models.UniqueConstraint( | ||
django.db.models.functions.text.Lower("name"), | ||
models.F("location"), | ||
condition=models.Q(("deleted", False)), | ||
name="unique_bed_name_per_location", | ||
), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters