# Generated by Django 3.0.8 on 2020-07-02 13:13

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='Answer',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('answerB', models.BooleanField(null=True)),
                ('answerO', models.TextField(null=True)),
                ('active', models.BooleanField(default=True)),
                ('creation_date', models.DateTimeField(auto_now_add=True)),
                ('update_date', models.DateTimeField(auto_now=True)),
            ],
        ),
        migrations.CreateModel(
            name='Course',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('next_course', models.IntegerField(blank=True, null=True)),
                ('first', models.BooleanField(default=False)),
                ('active', models.BooleanField(default=True)),
                ('creation_date', models.DateTimeField(auto_now_add=True)),
                ('update_date', models.DateTimeField(auto_now=True)),
            ],
        ),
        migrations.CreateModel(
            name='Lesson',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('approval_score', models.IntegerField(null=True)),
                ('next_lesson', models.IntegerField(blank=True, null=True)),
                ('first', models.BooleanField(default=False)),
                ('active', models.BooleanField(default=True)),
                ('creation_date', models.DateTimeField(auto_now_add=True)),
                ('update_date', models.DateTimeField(auto_now=True)),
            ],
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('active', models.BooleanField(default=True)),
                ('creation_date', models.DateTimeField(auto_now_add=True)),
                ('update_date', models.DateTimeField(auto_now=True)),
                ('completed_courses', models.ManyToManyField(related_name='answers', to='Cursos.Course')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='perfil_usr', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'permissions': (('maestro', 'Permiso para crear y administrar cursos, lecciones, y preguntas'),),
            },
        ),
        migrations.CreateModel(
            name='Question',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('question_text', models.TextField(default=False)),
                ('multiple', models.BooleanField(default=False)),
                ('allselected', models.BooleanField(default=True)),
                ('options', models.TextField(null=True)),
                ('score', models.IntegerField(null=True)),
                ('active', models.BooleanField(default=True)),
                ('creation_date', models.DateTimeField(auto_now_add=True)),
                ('update_date', models.DateTimeField(auto_now=True)),
            ],
        ),
        migrations.CreateModel(
            name='ProfileLesson',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('active', models.BooleanField(default=True)),
                ('creation_date', models.DateTimeField(auto_now_add=True)),
                ('update_date', models.DateTimeField(auto_now=True)),
                ('answers', models.ManyToManyField(related_name='answers', to='Cursos.Answer')),
                ('lesson', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='lessonu', to='Cursos.Lesson')),
                ('profile', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='perfilu', to='Cursos.Profile')),
            ],
        ),
        migrations.AddField(
            model_name='lesson',
            name='questions',
            field=models.ManyToManyField(related_name='questions', to='Cursos.Question'),
        ),
        migrations.AddField(
            model_name='course',
            name='lessons',
            field=models.ManyToManyField(related_name='lesson', to='Cursos.Lesson'),
        ),
        migrations.AddField(
            model_name='answer',
            name='question',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='Cursos.Question'),
        ),
    ]
