优化model

This commit is contained in:
XIE7654
2025-07-17 16:17:57 +08:00
parent 9b30115444
commit 6ed606f7a4
11 changed files with 316 additions and 193 deletions

View File

@@ -0,0 +1,40 @@
# Generated by Django 5.2.1 on 2025-07-17 07:07
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("ai", "0003_aimodel_model_type"),
]
operations = [
migrations.AlterField(
model_name="chatconversation",
name="model_id",
field=models.ForeignKey(
blank=True,
db_column="model_id",
db_comment="向量模型编号",
null=True,
on_delete=django.db.models.deletion.CASCADE,
to="ai.aimodel",
verbose_name="向量模型编号",
),
),
migrations.AlterField(
model_name="chatmessage",
name="model_id",
field=models.ForeignKey(
blank=True,
db_column="model_id",
db_comment="向量模型编号",
null=True,
on_delete=django.db.models.deletion.CASCADE,
to="ai.aimodel",
verbose_name="向量模型编号",
),
),
]

View File

@@ -258,6 +258,7 @@ class ChatConversation(CoreModel):
model_id = models.ForeignKey(
'AIModel',
on_delete=models.CASCADE,
null=True, blank=True,
db_column='model_id',
verbose_name="向量模型编号",
db_comment='向量模型编号'
@@ -302,6 +303,7 @@ class ChatMessage(CoreModel):
model_id = models.ForeignKey(
'AIModel',
on_delete=models.CASCADE,
null=True, blank=True,
db_column='model_id',
verbose_name="向量模型编号",
db_comment='向量模型编号'