# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-04-18 13:21
from __future__ import unicode_literals

import askup_lti.models
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='LtiProvider',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('consumer_name', models.CharField(max_length=255, unique=True)),
                ('consumer_key', models.CharField(default=askup_lti.models.short_token, max_length=32, unique=True)),
                ('consumer_secret', models.CharField(default=askup_lti.models.short_token, max_length=32, unique=True)),
            ],
            options={
                'verbose_name': 'LMS Platform',
                'verbose_name_plural': 'LMS Platforms',
            },
        ),
        migrations.CreateModel(
            name='LtiUser',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('user_id', models.CharField(max_length=255)),
                ('email', models.CharField(blank=True, max_length=255, null=True)),
                ('askup_user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='lti_user', to=settings.AUTH_USER_MODEL)),
                ('lti_consumer', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='askup_lti.LtiProvider')),
            ],
            options={
                'verbose_name': 'LTI User',
                'verbose_name_plural': 'LTI Users',
            },
        ),
        migrations.AlterUniqueTogether(
            name='ltiuser',
            unique_together=set([('lti_consumer', 'user_id')]),
        ),
    ]
