# Generated by Django 6.0.1 on 2026-02-11 06:43

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('shop', '0025_vccourse_alter_courseenrollment_course_and_more'),
    ]

    operations = [
        migrations.CreateModel(
            name='Activity',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=100, verbose_name='活动标题')),
                ('description', models.TextField(verbose_name='活动详情')),
                ('banner', models.ImageField(upload_to='activities/banners/', verbose_name='活动Banner图')),
                ('start_time', models.DateTimeField(verbose_name='开始时间')),
                ('end_time', models.DateTimeField(verbose_name='结束时间')),
                ('location', models.CharField(max_length=100, verbose_name='活动地点')),
                ('max_participants', models.IntegerField(default=50, verbose_name='最大报名人数')),
                ('is_active', models.BooleanField(default=True, verbose_name='是否启用')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
            ],
            options={
                'verbose_name': '社区活动',
                'verbose_name_plural': '社区活动管理',
            },
        ),
        migrations.CreateModel(
            name='Topic',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=200, verbose_name='标题')),
                ('content', models.TextField(verbose_name='内容')),
                ('view_count', models.IntegerField(default=0, verbose_name='浏览量')),
                ('is_pinned', models.BooleanField(default=False, verbose_name='置顶')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='发布时间')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='topics', to='shop.wechatuser', verbose_name='作者')),
                ('related_product', models.ForeignKey(blank=True, help_text='如果是技术求助，请选择关联的硬件', null=True, on_delete=django.db.models.deletion.SET_NULL, to='shop.esp32config', verbose_name='关联硬件')),
            ],
            options={
                'verbose_name': '论坛帖子',
                'verbose_name_plural': '论坛帖子管理',
                'ordering': ['-is_pinned', '-created_at'],
            },
        ),
        migrations.CreateModel(
            name='Reply',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('content', models.TextField(verbose_name='回复内容')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='回复时间')),
                ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='replies', to='shop.wechatuser', verbose_name='回复者')),
                ('reply_to', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='children', to='community.reply', verbose_name='回复楼层')),
                ('topic', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='replies', to='community.topic', verbose_name='所属帖子')),
            ],
            options={
                'verbose_name': '帖子回复',
                'verbose_name_plural': '帖子回复管理',
                'ordering': ['created_at'],
            },
        ),
        migrations.CreateModel(
            name='ActivitySignup',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('signup_time', models.DateTimeField(auto_now_add=True, verbose_name='报名时间')),
                ('status', models.CharField(choices=[('pending', '审核中'), ('confirmed', '报名成功'), ('cancelled', '已取消')], default='confirmed', max_length=20, verbose_name='状态')),
                ('activity', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='signups', to='community.activity', verbose_name='活动')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='activity_signups', to='shop.wechatuser', verbose_name='报名用户')),
            ],
            options={
                'verbose_name': '活动报名',
                'verbose_name_plural': '活动报名管理',
                'unique_together': {('activity', 'user')},
            },
        ),
    ]
