# Generated by Django 3.2.18 on 2023-04-02 16:23

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Chapter',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('index', models.CharField(choices=[('第一章', 'One'), ('第二章', 'Two'), ('第三章', 'Three'), ('第四章', 'Four'), ('第五章', 'Five'), ('第六章', 'Six'), ('第七章', 'Seven'), ('第八章', 'Eight'), ('第九章', 'Nine'), ('第十章', 'Ten'), ('第十一章', 'Eleven'), ('第十二章', 'Twelve')], max_length=50)),
                ('title', models.CharField(max_length=100)),
                ('description', models.TextField(null=True)),
                ('cover_img_url', models.CharField(default=None, max_length=255)),
                ('view_count', models.IntegerField(default=0)),
                ('is_active', models.BooleanField(default=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Course',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('title', models.CharField(max_length=50)),
                ('description', models.TextField(null=True)),
                ('price', models.FloatField(default=0)),
                ('cover_img_url', models.CharField(max_length=255)),
                ('view_count', models.IntegerField(default=0)),
                ('sale_count', models.IntegerField(default=0)),
                ('is_active', models.BooleanField(default=True)),
                ('level', models.IntegerField(choices=[(0, 'Easy'), (1, 'Base'), (2, 'Advanced'), (3, 'Pro')], default=1)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Language',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('content_type', models.CharField(max_length=50)),
                ('description', models.TextField()),
                ('name', models.CharField(max_length=50)),
                ('compile_command', models.TextField()),
                ('is_spj', models.BooleanField()),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Lession',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('index', models.IntegerField()),
                ('title', models.CharField(max_length=100)),
                ('is_active', models.BooleanField(default=True)),
                ('chapter_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='course.chapter')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Problem',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('judge_type', models.CharField(choices=[('spj', 'Spj'), ('common', 'Common')], default='common', max_length=10)),
                ('problem_id', models.CharField(max_length=20, unique=True)),
                ('title', models.CharField(max_length=100)),
                ('type', models.IntegerField(choices=[(0, 'Acm'), (1, 'Oi')], default=1)),
                ('time_limit', models.IntegerField(default=1000)),
                ('memory_limit', models.IntegerField(default=128)),
                ('start_limit', models.IntegerField(default=128)),
                ('description', models.TextField()),
                ('input_description', models.TextField()),
                ('output_description', models.TextField()),
                ('examples', models.TextField()),
                ('degree', models.IntegerField(choices=[(0, 'Easy'), (1, 'Base'), (2, 'Medium'), (3, 'Hard')], default=1)),
                ('hint', models.TextField(null=True)),
                ('auth', models.IntegerField(choices=[(0, 'Public'), (1, 'Private'), (2, 'Contest')], default=0)),
                ('io_score', models.IntegerField(default=100)),
                ('code_share', models.BooleanField(default=True)),
                ('spj_code', models.TextField(null=True)),
                ('spj_language', models.CharField(max_length=50, null=True)),
                ('is_remove_end_blank', models.BooleanField(default=True)),
                ('is_open_case', models.BooleanField(default=True)),
                ('is_upload_case', models.BooleanField(default=True)),
                ('is_active', models.BooleanField(default=True)),
                ('lession_id', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='course.lession')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Video',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('title', models.CharField(max_length=100)),
                ('img_url', models.CharField(max_length=255)),
                ('video_url', models.CharField(max_length=255)),
                ('count', models.IntegerField(default=0)),
                ('is_free', models.BooleanField(default=False)),
                ('duration', models.IntegerField()),
                ('size', models.IntegerField()),
                ('status', models.IntegerField(choices=[(0, 'Private'), (1, 'Uploading'), (2, 'Public')], default=2)),
                ('description', models.CharField(max_length=255, null=True)),
                ('is_active', models.BooleanField(default=True)),
                ('lession', models.OneToOneField(on_delete=django.db.models.deletion.DO_NOTHING, to='course.lession')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Tag',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('name', models.CharField(max_length=50)),
                ('status', models.BooleanField(default=True)),
                ('problems', models.ManyToManyField(to='course.Problem')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='chapter',
            name='course_id',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='course.course'),
        ),
        migrations.CreateModel(
            name='Case',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('input', models.TextField()),
                ('output', models.TextField()),
                ('status', models.BooleanField(default=True)),
                ('problem_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='course.problem')),
            ],
            options={
                'db_table': 'case',
            },
        ),
    ]
