Skip to content

Commit

Permalink
performance(User): add db_index on User.public_id
Browse files Browse the repository at this point in the history
fix: code style
  • Loading branch information
calummackervoy committed Jul 8, 2024
1 parent 8f1e2a3 commit af9f1d6
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
20 changes: 20 additions & 0 deletions itou/users/migrations/0009_alter_user_public_id.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Generated by Django 5.0.6 on 2024-07-08 15:09
import uuid

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("users", "0008_fix_user_public_id"),
]

operations = [
migrations.AlterField(
model_name="user",
name="public_id",
field=models.UUIDField(
db_index=True, default=uuid.uuid4, unique=True, verbose_name="identifiant public opaque, pour les API"
),
),
]
1 change: 1 addition & 0 deletions itou/users/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ class User(AbstractUser, AddressMixin):
verbose_name="identifiant public opaque, pour les API",
default=uuid.uuid4,
unique=True,
db_index=True,
)

address_filled_at = models.DateTimeField(
Expand Down

0 comments on commit af9f1d6

Please sign in to comment.