# Generated by Django 4.2 on 2026-02-09 06:31

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name="AppVersion",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "platform",
                    models.CharField(
                        choices=[("ios", "iOS"), ("android", "Android")],
                        max_length=20,
                        verbose_name="平台",
                    ),
                ),
                ("version", models.CharField(max_length=20, verbose_name="版本号")),
                (
                    "force_update",
                    models.BooleanField(default=False, verbose_name="是否强制更新"),
                ),
                (
                    "update_url",
                    models.URLField(
                        blank=True, default="", max_length=500, verbose_name="下载地址"
                    ),
                ),
                (
                    "release_notes",
                    models.TextField(blank=True, default="", verbose_name="更新说明"),
                ),
                (
                    "created_at",
                    models.DateTimeField(auto_now_add=True, verbose_name="创建时间"),
                ),
                (
                    "updated_at",
                    models.DateTimeField(auto_now=True, verbose_name="更新时间"),
                ),
            ],
            options={
                "verbose_name": "App版本",
                "verbose_name_plural": "App版本",
                "db_table": "app_version",
                "ordering": ["-created_at"],
            },
        ),
        migrations.CreateModel(
            name="Feedback",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("content", models.TextField(verbose_name="反馈内容")),
                (
                    "contact",
                    models.CharField(
                        blank=True, default="", max_length=100, verbose_name="联系方式"
                    ),
                ),
                (
                    "created_at",
                    models.DateTimeField(auto_now_add=True, verbose_name="创建时间"),
                ),
                (
                    "updated_at",
                    models.DateTimeField(auto_now=True, verbose_name="更新时间"),
                ),
                (
                    "user",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="feedbacks",
                        to=settings.AUTH_USER_MODEL,
                        verbose_name="用户",
                    ),
                ),
            ],
            options={
                "verbose_name": "用户反馈",
                "verbose_name_plural": "用户反馈",
                "db_table": "feedback",
                "ordering": ["-created_at"],
            },
        ),
    ]
