feat: DB constraints for phone auth
This commit is contained in:
+25
@@ -0,0 +1,25 @@
|
||||
# Generated by Django 6.0.3 on 2026-03-13 20:53
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("accounts", "0003_preferred_language"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name="user",
|
||||
name="phone_number",
|
||||
field=models.CharField(max_length=20, unique=True),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name="user",
|
||||
constraint=models.CheckConstraint(
|
||||
condition=models.Q(("phone_number__regex", r"^\+[1-9][0-9]{7,14}$")),
|
||||
name="accounts_user_phone_e164_format",
|
||||
),
|
||||
),
|
||||
]
|
||||
Reference in New Issue
Block a user