# Generated by Django 3.0.1 on 2019-12-23 23:27

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Group',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=6)),
            ],
        ),
        migrations.CreateModel(
            name='Lecture',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('text', models.TextField()),
                ('version', models.IntegerField()),
                ('created', models.DateTimeField(auto_now=True)),
                ('modified', models.DateTimeField()),
            ],
        ),
        migrations.CreateModel(
            name='LecturePack',
            fields=[
                ('pack_name', models.CharField(max_length=150, primary_key=True, serialize=False)),
                ('description', models.CharField(max_length=150)),
            ],
        ),
        migrations.CreateModel(
            name='Subject',
            fields=[
                ('name', models.CharField(max_length=150, primary_key=True, serialize=False)),
                ('lecture', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='vcs.Lecture')),
            ],
        ),
        migrations.CreateModel(
            name='User',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('password', models.CharField(max_length=128, verbose_name='password')),
                ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
                ('full_name', models.CharField(max_length=250)),
                ('type', models.CharField(max_length=20)),
                ('date_registered', models.DateTimeField(auto_now=True)),
                ('group', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='vcs.Group')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='TeacherSubject',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('subject', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='vcs.Subject')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='vcs.User')),
            ],
        ),
        migrations.AddField(
            model_name='subject',
            name='teacher',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='vcs.User'),
        ),
        migrations.CreateModel(
            name='LectureComment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('text', models.TextField()),
                ('datetime', models.DateTimeField()),
                ('likes', models.IntegerField()),
                ('lecture', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='vcs.Lecture')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='vcs.User')),
            ],
        ),
        migrations.CreateModel(
            name='LectureActivity',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('view_count', models.IntegerField()),
                ('like_count', models.IntegerField()),
                ('comment_count', models.IntegerField()),
                ('grade', models.IntegerField()),
                ('lecture', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='vcs.Lecture')),
                ('student', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='vcs.User')),
            ],
        ),
        migrations.AddField(
            model_name='lecture',
            name='pack',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='vcs.LecturePack'),
        ),
        migrations.AddField(
            model_name='lecture',
            name='prev_lecture',
            field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='vcs.Lecture'),
        ),
        migrations.CreateModel(
            name='GroupSubject',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('group', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='vcs.Group')),
                ('subject', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='vcs.Subject')),
            ],
        ),
    ]
