# Generated by Django 2.1.3 on 2019-01-28 16:46

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone


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=100)),
                ('price', models.IntegerField()),
                ('image', models.ImageField(upload_to='images/')),
                ('discription', models.TextField(max_length=300)),
                ('mission', models.TextField(max_length=300)),
                ('outcomes', models.TextField(max_length=300)),
                ('rating', models.IntegerField(default=0)),
                ('pub_date', models.DateTimeField()),
                ('instructor', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Lecture',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('chapter', models.CharField(default='Новый раздел', max_length=100)),
                ('title', models.CharField(max_length=100)),
                ('video', models.FileField(null=True, upload_to='videos/', verbose_name='video')),
                ('attachments', models.FileField(null=True, upload_to='attachments/', verbose_name='attachments')),
                ('course', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='lecture', to='courses.Course')),
            ],
        ),
        migrations.CreateModel(
            name='Review',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('text', models.TextField()),
                ('created_date', models.DateTimeField(default=django.utils.timezone.now)),
                ('approved_review', models.BooleanField(default=False)),
                ('rating', models.IntegerField(default=5)),
                ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
                ('course', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='review', to='courses.Course')),
            ],
        ),
    ]
