mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 13:03:29 +00:00
external_auth_id: Add new unique constraint.
This commit is contained in:
committed by
Tim Abbott
parent
51c596b9c7
commit
58427f8ed1
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 5.2.4 on 2025-08-12 18:15
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
("zerver", "0750_multiuseinvite_welcome_message_custom_text_and_more"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddConstraint(
|
||||
model_name="externalauthid",
|
||||
constraint=models.UniqueConstraint(
|
||||
fields=("user", "external_auth_method_name"), name="zerver_user_externalauth_uniq"
|
||||
),
|
||||
),
|
||||
]
|
||||
@@ -1265,4 +1265,13 @@ class ExternalAuthID(models.Model):
|
||||
],
|
||||
name="zerver_externalauthid_uniq",
|
||||
),
|
||||
# Each user should only have at most a single ExternalAuthID
|
||||
# for any authentication method.
|
||||
models.UniqueConstraint(
|
||||
fields=[
|
||||
"user",
|
||||
"external_auth_method_name",
|
||||
],
|
||||
name="zerver_user_externalauth_uniq",
|
||||
),
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user