# Generated by Django 3.0.5 on 2021-06-28 01:59

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),
        ('system', '0018_auto_20210430_1156'),
    ]

    operations = [
        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_deleted', models.BooleanField(default=False, help_text='删除标记', verbose_name='删除标记')),
                ('name', models.CharField(max_length=100, verbose_name='视频名称')),
                ('description', models.TextField(default='', verbose_name='视频描述')),
                ('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='观看次数')),
                ('category', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='system.Dict', verbose_name='视频分类')),
                ('create_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='video_create_by', to=settings.AUTH_USER_MODEL, verbose_name='创建人')),
                ('update_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='video_update_by', to=settings.AUTH_USER_MODEL, verbose_name='最后编辑人')),
            ],
            options={
                'verbose_name': '点播视频',
                'verbose_name_plural': '点播视频',
            },
        ),
        migrations.CreateModel(
            name='ViewRecord',
            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_deleted', models.BooleanField(default=False, help_text='删除标记', verbose_name='删除标记')),
                ('num', models.IntegerField(default=0, verbose_name='观看次数')),
                ('current', models.IntegerField(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, to='vod.Video', verbose_name='点播视频')),
            ],
            options={
                'verbose_name': '点播观看记录',
                'verbose_name_plural': '点播观看记录',
            },
        ),
    ]
