# Generated by Django 5.1.5 on 2025-04-26 02:47

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


class Migration(migrations.Migration):

    dependencies = [
        ('user_management', '0002_knowledgebasedocument_uploader_name'),
    ]

    operations = [
        migrations.CreateModel(
            name='OperatorAccount',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('username', models.CharField(max_length=100, unique=True, verbose_name='用户名')),
                ('password', models.CharField(max_length=255, verbose_name='密码')),
                ('real_name', models.CharField(max_length=50, verbose_name='真实姓名')),
                ('email', models.EmailField(max_length=254, verbose_name='邮箱')),
                ('phone', models.CharField(max_length=15, verbose_name='电话')),
                ('position', models.CharField(choices=[('editor', '编辑'), ('planner', '策划'), ('operator', '运营'), ('admin', '管理员')], max_length=20, verbose_name='工作定位')),
                ('department', models.CharField(max_length=50, verbose_name='部门')),
                ('is_active', models.BooleanField(default=True, verbose_name='是否在职')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
            ],
            options={
                'verbose_name': '运营账号',
                'verbose_name_plural': '运营账号',
            },
        ),
        migrations.CreateModel(
            name='PlatformAccount',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('platform_name', models.CharField(choices=[('youtube', 'YouTube'), ('tiktok', 'TikTok'), ('twitter', 'Twitter/X'), ('instagram', 'Instagram'), ('facebook', 'Facebook'), ('bilibili', 'Bilibili')], max_length=20, verbose_name='平台名称')),
                ('account_name', models.CharField(max_length=100, verbose_name='账号名称')),
                ('account_id', models.CharField(max_length=100, verbose_name='账号ID')),
                ('status', models.CharField(choices=[('active', '正常'), ('restricted', '限流'), ('suspended', '封禁'), ('inactive', '未激活')], default='active', max_length=20, verbose_name='账号状态')),
                ('followers_count', models.IntegerField(default=0, verbose_name='粉丝数')),
                ('account_url', models.URLField(verbose_name='账号链接')),
                ('description', models.TextField(blank=True, null=True, verbose_name='账号描述')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='最后登录时间')),
                ('operator', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='platform_accounts', to='user_management.operatoraccount', verbose_name='关联运营')),
            ],
            options={
                'verbose_name': '平台账号',
                'verbose_name_plural': '平台账号',
                'unique_together': {('platform_name', 'account_id')},
            },
        ),
        migrations.CreateModel(
            name='Video',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=200, verbose_name='视频标题')),
                ('description', models.TextField(blank=True, null=True, verbose_name='视频描述')),
                ('video_url', models.URLField(blank=True, null=True, verbose_name='视频地址')),
                ('local_path', models.CharField(blank=True, max_length=255, null=True, verbose_name='本地路径')),
                ('thumbnail_url', models.URLField(blank=True, null=True, verbose_name='缩略图地址')),
                ('status', models.CharField(choices=[('draft', '草稿'), ('scheduled', '已排期'), ('published', '已发布'), ('failed', '发布失败'), ('deleted', '已删除')], default='draft', max_length=20, verbose_name='发布状态')),
                ('views_count', models.IntegerField(default=0, verbose_name='播放次数')),
                ('likes_count', models.IntegerField(default=0, verbose_name='点赞数')),
                ('comments_count', models.IntegerField(default=0, verbose_name='评论数')),
                ('shares_count', models.IntegerField(default=0, verbose_name='分享数')),
                ('tags', models.CharField(blank=True, max_length=500, null=True, verbose_name='标签')),
                ('publish_time', models.DateTimeField(blank=True, null=True, verbose_name='发布时间')),
                ('scheduled_time', models.DateTimeField(blank=True, null=True, verbose_name='计划发布时间')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('platform_account', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='videos', to='user_management.platformaccount', verbose_name='发布账号')),
            ],
            options={
                'verbose_name': '视频',
                'verbose_name_plural': '视频',
            },
        ),
    ]
