# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-07-15 03:00
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('account', '0010_auto_20160709_1051'),
    ]

    operations = [
        migrations.CreateModel(
            name='AuthCode',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('scopes', models.CharField(choices=[('auth_base', 'Auth Login Only'), ('auth_userinfo', 'Get UserInfo')], default='auth_base', max_length=20)),
                ('code', models.CharField(max_length=100, unique=True)),
                ('expires_at', models.IntegerField(default=0)),
                ('account', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='account.User')),
            ],
        ),
        migrations.CreateModel(
            name='Client',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, max_length=50, null=True)),
                ('password', models.CharField(blank=True, max_length=100, null=True)),
                ('app_id', models.CharField(max_length=100, unique=True)),
                ('app_secert', models.CharField(blank=True, max_length=100, null=True)),
                ('grant_type', models.CharField(choices=[('authorization_code', 'Authorization code')], max_length=18)),
                ('response_type', models.CharField(choices=[('code', 'Authorization code')], max_length=4)),
                ('at_expires_time', models.IntegerField(default=7200)),
                ('rt_expires_time', models.IntegerField(default=604800)),
                ('scopes', models.CharField(choices=[('auth_base', 'Auth Login Only'), ('auth_userinfo', 'Get UserInfo')], default='auth_base', max_length=20)),
                ('redirect_uris', models.TextField(default='')),
                ('cancel_redirect_uri', models.TextField(default='')),
            ],
        ),
        migrations.CreateModel(
            name='Tokens',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('open_id', models.CharField(blank=True, max_length=100, null=True)),
                ('scopes', models.CharField(choices=[('auth_base', 'Auth Login Only'), ('auth_userinfo', 'Get UserInfo')], default='auth_base', max_length=20)),
                ('access_token', models.CharField(max_length=100, unique=True)),
                ('refresh_token', models.CharField(max_length=100, unique=True)),
                ('expires_at', models.IntegerField(default=0)),
                ('account', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='account.User')),
                ('client', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='oauth2.Client')),
            ],
        ),
        migrations.AddField(
            model_name='authcode',
            name='client',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='oauth2.Client'),
        ),
    ]
