# -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-04-20 14:27
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='Course',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=200)),
                ('description', models.CharField(max_length=200)),
                ('source_path', models.CharField(blank=True, default='', max_length=500, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Section',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=200)),
                ('description', models.CharField(max_length=200)),
                ('source_path', models.CharField(blank=True, default='', max_length=500, null=True)),
            ],
            options={
                'ordering': ['source_path'],
            },
        ),
        migrations.CreateModel(
            name='Slide',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(blank=True, default='', max_length=200, null=True)),
                ('title_short', models.CharField(blank=True, default='', max_length=200, null=True)),
                ('description', models.CharField(blank=True, default='', max_length=200, null=True)),
                ('icon', models.CharField(blank=True, max_length=200, null=True)),
                ('slide_type', models.CharField(default='text/html', max_length=200)),
                ('content', models.TextField(blank=True, default='', null=True)),
                ('solution', models.TextField(blank=True, default='', null=True)),
                ('grading', models.BooleanField(default=False)),
                ('data', models.TextField(blank=True, default='{}', null=True)),
                ('source_path', models.CharField(blank=True, default='', max_length=500, null=True)),
            ],
            options={
                'ordering': ['source_path'],
            },
        ),
        migrations.CreateModel(
            name='UserCourse',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('course', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='courses.Course')),
                ('progress_section', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='courses.Section')),
                ('progress_slide', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='courses.Slide')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='UserEvent',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('timestamp', models.DateTimeField(verbose_name='timestamp')),
                ('event_type', models.TextField()),
                ('event_data', models.TextField()),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='UserSolution',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('source_path', models.CharField(blank=True, default='', max_length=500, null=True)),
                ('data', models.TextField(blank=True, default='{}', null=True)),
                ('date', models.DateTimeField(verbose_name='date submitted')),
                ('passed', models.BooleanField()),
                ('tries', models.PositiveSmallIntegerField()),
                ('duration', models.DurationField()),
                ('slide', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='courses.Slide')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AddField(
            model_name='section',
            name='slides',
            field=models.ManyToManyField(to='courses.Slide'),
        ),
        migrations.AddField(
            model_name='course',
            name='sections',
            field=models.ManyToManyField(to='courses.Section'),
        ),
    ]
