# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2018-07-23 14:35
from __future__ import unicode_literals

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Consumer',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
                ('description', models.TextField()),
                ('key', models.CharField(max_length=18)),
                ('secret', models.CharField(max_length=32)),
                ('status', models.CharField(choices=[(b'pending', b'Pending'), (b'accepted', b'Accepted'), (b'canceled', b'Canceled'), (b'rejected', b'Rejected')], default=b'pending', max_length=16)),
                ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='consumers', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Nonce',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('token_key', models.CharField(max_length=18)),
                ('consumer_key', models.CharField(max_length=18)),
                ('key', models.CharField(max_length=255)),
            ],
        ),
        migrations.CreateModel(
            name='Token',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('key', models.CharField(max_length=18)),
                ('secret', models.CharField(max_length=32)),
                ('verifier', models.CharField(max_length=10)),
                ('token_type', models.IntegerField(choices=[(1, 'Request'), (2, 'Access')])),
                ('timestamp', models.IntegerField(default=1532349350L)),
                ('is_approved', models.BooleanField(default=False)),
                ('callback', models.CharField(blank=True, max_length=255, null=True)),
                ('callback_confirmed', models.BooleanField(default=False)),
                ('consumer', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='piston.Consumer')),
                ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='tokens', to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
