Skip to content
This repository was archived by the owner on Aug 29, 2023. It is now read-only.

Commit a8b43ef

Browse files
committed
Rewrite migration 0004 to remove already applied
1 parent dc0dd81 commit a8b43ef

File tree

1 file changed

+34
-32
lines changed

1 file changed

+34
-32
lines changed

oauth2_provider/migrations/0004_auto_20200902_2022.py

Lines changed: 34 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -15,38 +15,40 @@ class Migration(migrations.Migration):
1515
]
1616

1717
operations = [
18-
migrations.AddField(
19-
model_name='application',
20-
name='algorithm',
21-
field=models.CharField(blank=True, choices=[("", "No OIDC support"), ('RS256', 'RSA with SHA-2 256'), ('HS256', 'HMAC with SHA-2 256')], default='', max_length=5),
22-
),
23-
migrations.AlterField(
24-
model_name='application',
25-
name='authorization_grant_type',
26-
field=models.CharField(choices=[('authorization-code', 'Authorization code'), ('implicit', 'Implicit'), ('password', 'Resource owner password-based'), ('client-credentials', 'Client credentials'), ('openid-hybrid', 'OpenID connect hybrid')], max_length=32),
27-
),
28-
migrations.CreateModel(
29-
name='IDToken',
30-
fields=[
31-
('id', models.BigAutoField(primary_key=True, serialize=False)),
32-
("jti", models.UUIDField(unique=True, default=uuid.uuid4, editable=False, verbose_name="JWT Token ID")),
33-
('expires', models.DateTimeField()),
34-
('scope', models.TextField(blank=True)),
35-
('created', models.DateTimeField(auto_now_add=True)),
36-
('updated', models.DateTimeField(auto_now=True)),
37-
('application', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=oauth2_settings.APPLICATION_MODEL)),
38-
('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='oauth2_provider_idtoken', to=settings.AUTH_USER_MODEL)),
39-
],
40-
options={
41-
'abstract': False,
42-
'swappable': 'OAUTH2_PROVIDER_ID_TOKEN_MODEL',
43-
},
44-
),
45-
migrations.AddField(
46-
model_name='accesstoken',
47-
name='id_token',
48-
field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='access_token', to=oauth2_settings.ID_TOKEN_MODEL),
49-
),
18+
# Skip the already applied migrations below
19+
# -----------------------------------------------------------------
20+
# migrations.AddField(
21+
# model_name='application',
22+
# name='algorithm',
23+
# field=models.CharField(blank=True, choices=[("", "No OIDC support"), ('RS256', 'RSA with SHA-2 256'), ('HS256', 'HMAC with SHA-2 256')], default='', max_length=5),
24+
# ),
25+
# migrations.AlterField(
26+
# model_name='application',
27+
# name='authorization_grant_type',
28+
# field=models.CharField(choices=[('authorization-code', 'Authorization code'), ('implicit', 'Implicit'), ('password', 'Resource owner password-based'), ('client-credentials', 'Client credentials'), ('openid-hybrid', 'OpenID connect hybrid')], max_length=32),
29+
# ),
30+
# migrations.CreateModel(
31+
# name='IDToken',
32+
# fields=[
33+
# ('id', models.BigAutoField(primary_key=True, serialize=False)),
34+
# ("jti", models.UUIDField(unique=True, default=uuid.uuid4, editable=False, verbose_name="JWT Token ID")),
35+
# ('expires', models.DateTimeField()),
36+
# ('scope', models.TextField(blank=True)),
37+
# ('created', models.DateTimeField(auto_now_add=True)),
38+
# ('updated', models.DateTimeField(auto_now=True)),
39+
# ('application', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=oauth2_settings.APPLICATION_MODEL)),
40+
# ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='oauth2_provider_idtoken', to=settings.AUTH_USER_MODEL)),
41+
# ],
42+
# options={
43+
# 'abstract': False,
44+
# 'swappable': 'OAUTH2_PROVIDER_ID_TOKEN_MODEL',
45+
# },
46+
# ),
47+
# migrations.AddField(
48+
# model_name='accesstoken',
49+
# name='id_token',
50+
# field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='access_token', to=oauth2_settings.ID_TOKEN_MODEL),
51+
# ),
5052
migrations.AddField(
5153
model_name="grant",
5254
name="nonce",

0 commit comments

Comments
 (0)