|
| 1 | +# Generated by Django 5.1.5 on 2025-01-24 14:00 |
| 2 | + |
| 3 | +import django.db.models.deletion |
| 4 | +from django.conf import settings |
| 5 | +from django.db import migrations, models |
| 6 | + |
| 7 | + |
| 8 | +class Migration(migrations.Migration): |
| 9 | + |
| 10 | + dependencies = [ |
| 11 | + ('oauth2_provider', '0012_add_token_checksum'), |
| 12 | + migrations.swappable_dependency(settings.AUTH_USER_MODEL), |
| 13 | + ] |
| 14 | + |
| 15 | + operations = [ |
| 16 | + migrations.AlterField( |
| 17 | + model_name='application', |
| 18 | + name='authorization_grant_type', |
| 19 | + field=models.CharField(choices=[('authorization-code', 'Authorization code'), ('urn:ietf:params:oauth:grant-type:device_code', 'Device Code'), ('implicit', 'Implicit'), ('password', 'Resource owner password-based'), ('client-credentials', 'Client credentials'), ('openid-hybrid', 'OpenID connect hybrid')], max_length=44), |
| 20 | + ), |
| 21 | + migrations.CreateModel( |
| 22 | + name='Device', |
| 23 | + fields=[ |
| 24 | + ('id', models.BigAutoField(primary_key=True, serialize=False)), |
| 25 | + ('device_code', models.CharField(max_length=100, unique=True)), |
| 26 | + ('user_code', models.CharField(max_length=100)), |
| 27 | + ('scope', models.CharField(max_length=64, null=True)), |
| 28 | + ('interval', models.IntegerField(default=5)), |
| 29 | + ('expires', models.DateTimeField()), |
| 30 | + ('status', models.CharField(blank=True, choices=[('authorized', 'Authorized'), ('authorization-pending', 'Authorization pending'), ('expired', 'Expired'), ('denied', 'Denied')], default='authorization-pending', max_length=64)), |
| 31 | + ('client_id', models.CharField(db_index=True, max_length=100)), |
| 32 | + ('last_checked', models.DateTimeField(auto_now=True)), |
| 33 | + ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='%(app_label)s_%(class)s', to=settings.AUTH_USER_MODEL)), |
| 34 | + ], |
| 35 | + options={ |
| 36 | + 'abstract': False, |
| 37 | + 'swappable': 'OAUTH2_PROVIDER_DEVICE_MODEL', |
| 38 | + 'constraints': [models.UniqueConstraint(fields=('device_code',), name='oauth2_provider_device_unique_device_code')], |
| 39 | + }, |
| 40 | + ), |
| 41 | + ] |
0 commit comments