Skip to content

Commit b8763da

Browse files
authored
Add index to AccessToken.token (#1312)
1 parent a4ae1d4 commit b8763da

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Generated by Django 4.2.4 on 2023-09-11 07:03
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
dependencies = [
8+
("oauth2_provider", "0007_application_post_logout_redirect_uris"),
9+
]
10+
11+
operations = [
12+
migrations.AlterField(
13+
model_name="accesstoken",
14+
name="token",
15+
field=models.CharField(db_index=True, max_length=255, unique=True),
16+
),
17+
]

oauth2_provider/models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,7 @@ class AbstractAccessToken(models.Model):
357357
token = models.CharField(
358358
max_length=255,
359359
unique=True,
360+
db_index=True,
360361
)
361362
id_token = models.OneToOneField(
362363
oauth2_settings.ID_TOKEN_MODEL,

0 commit comments

Comments
 (0)