From a765e6a4087127c081e16ccabd0426099fcee6aa Mon Sep 17 00:00:00 2001 From: Michael Helvey Date: Tue, 23 Jun 2020 13:16:22 -0500 Subject: [PATCH 1/2] remove unique index from IDToken.token On MySQL 8.0 (and before, as far as I know) creating a unique TEXT index will fail with err 1170 "BLOB/TEXT column 'token' used in key specification without a key length" --- oauth2_provider/migrations/0004_idtoken.py | 2 +- oauth2_provider/models.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/oauth2_provider/migrations/0004_idtoken.py b/oauth2_provider/migrations/0004_idtoken.py index 853a7089f..e765fafd2 100644 --- a/oauth2_provider/migrations/0004_idtoken.py +++ b/oauth2_provider/migrations/0004_idtoken.py @@ -15,7 +15,7 @@ class Migration(migrations.Migration): name='IDToken', fields=[ ('id', models.BigAutoField(primary_key=True, serialize=False)), - ('token', models.TextField(unique=True)), + ('token', models.TextField()), ('expires', models.DateTimeField()), ('scope', models.TextField(blank=True)), ('created', models.DateTimeField(auto_now_add=True)), diff --git a/oauth2_provider/models.py b/oauth2_provider/models.py index 1421c89eb..7abff8ea0 100644 --- a/oauth2_provider/models.py +++ b/oauth2_provider/models.py @@ -449,7 +449,7 @@ class AbstractIDToken(models.Model): settings.AUTH_USER_MODEL, on_delete=models.CASCADE, blank=True, null=True, related_name="%(app_label)s_%(class)s" ) - token = models.TextField(unique=True) + token = models.TextField() application = models.ForeignKey( oauth2_settings.APPLICATION_MODEL, on_delete=models.CASCADE, blank=True, null=True, ) From 043855a27092a09a3fe7fda1908bfeb0c5ca65f8 Mon Sep 17 00:00:00 2001 From: Michael Helvey Date: Wed, 24 Jun 2020 17:04:42 -0500 Subject: [PATCH 2/2] added myself to AUTHORS --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index cbcefa213..a2729271d 100644 --- a/AUTHORS +++ b/AUTHORS @@ -27,3 +27,4 @@ pySilver Rodney Richardson Silvano Cerza Stéphane Raimbault +Michael Helvey