# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-03-03 19:27
from __future__ import unicode_literals

from django.conf import settings
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('sites', '0002_alter_domain_unique'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='SocialAccount',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('provider', models.CharField(choices=[('facebook', 'Facebook'), ('github', 'Github'), ('google', 'Google')], max_length=30)),
                ('uid', models.CharField(max_length=512, unique=True)),
                ('last_login', models.DateTimeField(auto_now=True)),
                ('date_joined', models.DateTimeField(auto_now_add=True)),
                ('extra_data', django.contrib.postgres.fields.jsonb.JSONField(default=dict)),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'db_table': 'SocialAccount',
            },
        ),
        migrations.CreateModel(
            name='SocialApp',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('provider', models.CharField(choices=[('facebook', 'Facebook'), ('github', 'Github'), ('google', 'Google')], max_length=30)),
                ('name', models.CharField(max_length=40)),
                ('client_id', models.CharField(help_text='App ID, or consumer key', max_length=256)),
                ('secret', models.CharField(help_text='API secret, client secret, or consumer secret', max_length=256)),
                ('key', models.CharField(blank=True, max_length=256)),
                ('sites', models.ManyToManyField(blank=True, to='sites.Site')),
            ],
            options={
                'db_table': 'SocialApp',
            },
        ),
        migrations.CreateModel(
            name='SocialToken',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('token', models.TextField(help_text='oauth_token (OAuth1) or access token (OAuth2)')),
                ('token_secret', models.TextField(blank=True, help_text='oauth_token_secret (OAuth1) or refresh token (OAuth2)')),
                ('expires_at', models.DateTimeField(blank=True, null=True)),
                ('account', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='socialaccount.SocialAccount')),
                ('app', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='socialaccount.SocialApp')),
            ],
            options={
                'db_table': 'SocialAppToken',
            },
        ),
        migrations.AlterUniqueTogether(
            name='socialtoken',
            unique_together=set([('app', 'account')]),
        ),
        migrations.AlterUniqueTogether(
            name='socialaccount',
            unique_together=set([('provider', 'uid')]),
        ),
    ]
