From 57270a7faf1a6da0623b9081dbd01e2b2920610f Mon Sep 17 00:00:00 2001 From: seaislee1209 Date: Sun, 29 Mar 2026 04:09:47 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=87=8D=E6=96=B0=E6=B7=BB=E5=8A=A0=20u?= =?UTF-8?q?pdated=5Fat=20migration=EF=BC=88=E4=BF=AE=E5=A4=8D=E7=BA=BF?= =?UTF-8?q?=E4=B8=8A=20IntegrityError=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Model 有 updated_at 字段但线上数据库缺少该列,INSERT 时报 "Field 'updated_at' doesn't have a default value",导致视频生成 500。 Co-Authored-By: Claude Opus 4.6 (1M context) --- .../migrations/0014_add_updated_at_to_record.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 backend/apps/generation/migrations/0014_add_updated_at_to_record.py diff --git a/backend/apps/generation/migrations/0014_add_updated_at_to_record.py b/backend/apps/generation/migrations/0014_add_updated_at_to_record.py new file mode 100644 index 0000000..293e14e --- /dev/null +++ b/backend/apps/generation/migrations/0014_add_updated_at_to_record.py @@ -0,0 +1,16 @@ +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('generation', '0013_add_video_token_price'), + ] + + operations = [ + migrations.AddField( + model_name='generationrecord', + name='updated_at', + field=models.DateTimeField(auto_now=True, verbose_name='更新时间'), + ), + ]