Skip to content

Commit

Permalink
Add index to AccessToken.token (#1312)
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-thoma committed Sep 11, 2023
1 parent a4ae1d4 commit b8763da
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
17 changes: 17 additions & 0 deletions oauth2_provider/migrations/0008_alter_accesstoken_token.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Django 4.2.4 on 2023-09-11 07:03

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("oauth2_provider", "0007_application_post_logout_redirect_uris"),
]

operations = [
migrations.AlterField(
model_name="accesstoken",
name="token",
field=models.CharField(db_index=True, max_length=255, unique=True),
),
]
1 change: 1 addition & 0 deletions oauth2_provider/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@ class AbstractAccessToken(models.Model):
token = models.CharField(
max_length=255,
unique=True,
db_index=True,
)
id_token = models.OneToOneField(
oauth2_settings.ID_TOKEN_MODEL,
Expand Down

0 comments on commit b8763da

Please sign in to comment.