# Generated by Django 2.2 on 2019-05-30 10:38

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),
        ('courses', '0001_initial'),
    ]

    operations = [
        migrations.AddField(
            model_name='usermodules',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='user_modules', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='modules',
            name='course',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='modules', to='courses.Courses'),
        ),
        migrations.AddField(
            model_name='modules',
            name='students',
            field=models.ManyToManyField(related_name='modules', through='courses.UserModules', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='enrolled',
            name='course',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='courses.Courses'),
        ),
        migrations.AddField(
            model_name='enrolled',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='courses',
            name='created_by',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='created_courses', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='courses',
            name='students',
            field=models.ManyToManyField(through='courses.Enrolled', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AlterUniqueTogether(
            name='usermodules',
            unique_together={('user', 'module')},
        ),
        migrations.AlterUniqueTogether(
            name='modules',
            unique_together={('course', 'order')},
        ),
    ]
