Browse Source

feat(account): update unique constraints for User model

- Modified the unique_together constraint for the User model to only require uniqueness on the email field, removing device_id from the constraints.
- Added a migration to apply this change to the database schema.
master
mortezaei 8 months ago
parent
commit
b028833ef6
  1. 17
      apps/account/migrations/0005_alter_user_unique_together.py
  2. 2
      apps/account/models/user.py

17
apps/account/migrations/0005_alter_user_unique_together.py

@ -0,0 +1,17 @@
# Generated by Django 3.2.4 on 2025-09-22 17:18
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('account', '0004_alter_user_avatar'),
]
operations = [
migrations.AlterUniqueTogether(
name='user',
unique_together={('email',)},
),
]

2
apps/account/models/user.py

@ -199,7 +199,7 @@ class User(AbstractUser):
verbose_name = "All Users"
verbose_name_plural = "All Users"
unique_together = (
'email', 'device_id'
'email',
)

Loading…
Cancel
Save