Skip to content

Commit 5e056b5

Browse files
committed
split up the AddField and AlterField with unique index to happen after the forward migration of existing tokens
1 parent 08c56f5 commit 5e056b5

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

oauth2_provider/migrations/0012_add_token_checksum.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,17 @@ class Migration(migrations.Migration):
2424
migrations.AddField(
2525
model_name="accesstoken",
2626
name="token_checksum",
27-
field=oauth2_provider.models.TokenChecksumField(
28-
blank=True, null=True, db_index=True, max_length=64, unique=True
29-
),
27+
field=oauth2_provider.models.TokenChecksumField(blank=True, null=True, max_length=64),
3028
),
3129
migrations.AlterField(
3230
model_name="accesstoken",
3331
name="token",
3432
field=models.TextField(),
3533
),
36-
migrations.RunPython(forwards_func),
34+
migrations.RunPython(forwards_func, migrations.RunPython.noop),
35+
migrations.AlterField(
36+
model_name='accesstoken',
37+
name='token_checksum',
38+
field=oauth2_provider.models.TokenChecksumField(blank=False, max_length=64, db_index=True, unique=True),
39+
),
3740
]

0 commit comments

Comments
 (0)