# Generated by Django 3.0.4 on 2022-03-13 14:41

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')),
                ('create_time', models.DateTimeField(default=django.utils.timezone.now, help_text='创建时间', verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, help_text='修改时间', verbose_name='修改时间')),
                ('is_delete', models.BooleanField(default=False, help_text='删除标记', verbose_name='删除标记')),
                ('name', models.CharField(max_length=200, verbose_name='名称')),
                ('description', models.TextField(blank=True, null=True, verbose_name='课程介绍')),
                ('sort', models.IntegerField(default=1, verbose_name='排序数字')),
                ('create_admin', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='course_create_admin', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Video',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('create_time', models.DateTimeField(default=django.utils.timezone.now, help_text='创建时间', verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, help_text='修改时间', verbose_name='修改时间')),
                ('is_delete', models.BooleanField(default=False, help_text='删除标记', verbose_name='删除标记')),
                ('name', models.CharField(max_length=100, verbose_name='视频名称')),
                ('description', models.TextField(blank=True, null=True, verbose_name='视频描述')),
                ('fileid', models.CharField(max_length=200, unique=True, verbose_name='云点播视频id')),
                ('mediaurl', models.CharField(max_length=200, verbose_name='视频地址')),
                ('coverurl', models.CharField(max_length=200, verbose_name='封面地址')),
                ('duration', models.IntegerField(default=0, verbose_name='时长(秒)')),
                ('views', models.IntegerField(default=0, verbose_name='观看次数')),
                ('viewsp', models.IntegerField(default=0, verbose_name='观看人数')),
                ('course', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='vod.Course', verbose_name='所属课程')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='VRecord',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('create_time', models.DateTimeField(default=django.utils.timezone.now, help_text='创建时间', verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, help_text='修改时间', verbose_name='修改时间')),
                ('is_delete', models.BooleanField(default=False, help_text='删除标记', verbose_name='删除标记')),
                ('views', models.PositiveIntegerField(default=0, verbose_name='观看次数')),
                ('completed', models.BooleanField(default=False, verbose_name='是否观看完成')),
                ('current', models.PositiveIntegerField(default=0, verbose_name='当前观看进度(秒)')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='viewrecord_user', to=settings.AUTH_USER_MODEL, verbose_name='观看人')),
                ('video', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='record_video', to='vod.Video', verbose_name='点播视频')),
            ],
            options={
                'abstract': False,
            },
        ),
    ]
