1 # This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
2 # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
4 from django.conf import settings
5 from django.db import migrations, models
6 import django.db.models.deletion
9 class Migration(migrations.Migration):
12 migrations.swappable_dependency(settings.AUTH_USER_MODEL),
13 ('api', '0004_bookuserdata_last_changed'),
17 migrations.CreateModel(
20 ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
21 ('name', models.CharField(max_length=255)),
22 ('description', models.TextField()),
23 ('key', models.CharField(max_length=18)),
24 ('secret', models.CharField(max_length=32)),
25 ('status', models.CharField(choices=[('pending', 'Pending approval'), ('accepted', 'Accepted'), ('canceled', 'Canceled')], default='pending', max_length=16)),
26 ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='consumers', to=settings.AUTH_USER_MODEL)),
29 migrations.CreateModel(
32 ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
33 ('token_key', models.CharField(max_length=18)),
34 ('consumer_key', models.CharField(max_length=18)),
35 ('key', models.CharField(max_length=255)),
38 migrations.CreateModel(
41 ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
42 ('key', models.CharField(max_length=18)),
43 ('secret', models.CharField(max_length=32)),
44 ('token_type', models.IntegerField(choices=[(1, 'Request'), (2, 'Access')])),
45 ('timestamp', models.IntegerField()),
46 ('is_approved', models.BooleanField(default=False)),
47 ('consumer', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.Consumer')),
48 ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='tokens', to=settings.AUTH_USER_MODEL)),