# Generated by Django 5.1.7 on 2025-04-01 09:47

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


class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name="Bot",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("name", models.CharField(max_length=255, verbose_name="机器人姓名")),
                ("description", models.TextField(verbose_name="机器人提示词")),
            ],
            options={
                "verbose_name": "机器人",
                "verbose_name_plural": "机器人",
            },
        ),
        migrations.CreateModel(
            name="ChatMessage",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("message", models.TextField(max_length=2048, verbose_name="消息内容")),
                (
                    "message_audio_url",
                    models.TextField(
                        blank=True, max_length=2048, verbose_name="消息内容语音链接"
                    ),
                ),
                (
                    "message_video_url",
                    models.TextField(
                        blank=True, max_length=2048, verbose_name="消息内容视频链接"
                    ),
                ),
                (
                    "timestamp",
                    models.DateTimeField(auto_now_add=True, verbose_name="时间戳"),
                ),
                (
                    "sender",
                    models.CharField(
                        choices=[
                            ("user", "user"),
                            ("assistant", "assistant"),
                            ("system", "system"),
                        ],
                        max_length=10,
                        verbose_name="发送者",
                    ),
                ),
                (
                    "message_type",
                    models.CharField(
                        choices=[
                            ("text", "text"),
                            ("audio", "audio"),
                            ("video", "video"),
                        ],
                        default="text",
                        max_length=10,
                        verbose_name="消息类型",
                    ),
                ),
                (
                    "bot",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="aiapp.bot",
                        verbose_name="机器人",
                    ),
                ),
            ],
            options={
                "verbose_name": "聊天消息",
                "verbose_name_plural": "聊天消息",
                "ordering": ["timestamp"],
            },
        ),
    ]
