-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use UniqueConstraint instead of unique_together for membership
- Loading branch information
Showing
2 changed files
with
43 additions
and
1 deletion.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
orgs/migrations/0003_remove_org_unique_domain_name_when_not_deleted_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,36 @@ | ||
# Generated by Django 4.2.7 on 2024-07-23 11:45 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('app_users', '0019_alter_appusertransaction_reason'), | ||
('orgs', '0002_alter_org_unique_together_and_more'), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveConstraint( | ||
model_name='org', | ||
name='unique_domain_name_when_not_deleted', | ||
), | ||
migrations.AlterUniqueTogether( | ||
name='orgmembership', | ||
unique_together=set(), | ||
), | ||
migrations.AlterField( | ||
model_name='orginvitation', | ||
name='status_changed_by', | ||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='received_invitations', to='app_users.appuser'), | ||
), | ||
migrations.AddConstraint( | ||
model_name='org', | ||
constraint=models.UniqueConstraint(condition=models.Q(('deleted__isnull', True)), fields=('domain_name',), name='unique_domain_name_when_not_deleted', violation_error_message='This domain name is already in use by another team. Contact Gooey.AI Support <[email protected]> if you think this is a mistake.'), | ||
), | ||
migrations.AddConstraint( | ||
model_name='orgmembership', | ||
constraint=models.UniqueConstraint(condition=models.Q(('deleted__isnull', True)), fields=('org', 'user'), name='unique_org_user'), | ||
), | ||
] |
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