-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes #10374: Require unique tenant names & slugs per group (not glo…
…bally)
- Loading branch information
1 parent
5517963
commit 8a08d36
Showing
4 changed files
with
67 additions
and
6 deletions.
There are no files selected for viewing
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
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,39 @@ | ||
# Generated by Django 4.1.7 on 2023-03-01 01:01 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('tenancy', '0009_standardize_description_comments'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='tenant', | ||
name='name', | ||
field=models.CharField(max_length=100), | ||
), | ||
migrations.AlterField( | ||
model_name='tenant', | ||
name='slug', | ||
field=models.SlugField(max_length=100), | ||
), | ||
migrations.AddConstraint( | ||
model_name='tenant', | ||
constraint=models.UniqueConstraint(fields=('group', 'name'), name='tenancy_tenant_unique_group_name', violation_error_message='Tenant name must be unique per group.'), | ||
), | ||
migrations.AddConstraint( | ||
model_name='tenant', | ||
constraint=models.UniqueConstraint(condition=models.Q(('group__isnull', True)), fields=('name',), name='tenancy_tenant_unique_name'), | ||
), | ||
migrations.AddConstraint( | ||
model_name='tenant', | ||
constraint=models.UniqueConstraint(fields=('group', 'slug'), name='tenancy_tenant_unique_group_slug', violation_error_message='Tenant slug must be unique per group.'), | ||
), | ||
migrations.AddConstraint( | ||
model_name='tenant', | ||
constraint=models.UniqueConstraint(condition=models.Q(('group__isnull', True)), fields=('slug',), name='tenancy_tenant_unique_slug'), | ||
), | ||
] |
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