大丈夫ではあるのですが、1本 migration が足りていませんでした。原因はこれです。

0006 で seedling_boxes_per_tan を installed_seedling_boxes にリネーム
その結果、DB 上の field メタ情報には元の表示名が残る
モデル側では今 verbose_name='設置苗箱枚数'
Django がその差分を AlterField として検出
なので、出ていた 0009_alter_ricetransplantentry_installed_seedling_boxes.py は正当です。こちらで 0009_alter_ricetransplantentry_installed_seedling_boxes.py を追加しました。

次はこれで進めれば大丈夫です。

git pull でこの migration を server 側へ反映
docker compose exec backend python manage.py migrate
必要なら docker compose exec backend python manage.py makemigrations plans --dry-run --verbosity 3 で警告が消えたか確認
これで plans の未反映 migration 警告は消えるはずです。
This commit is contained in:
akira
2026-04-05 12:17:04 +09:00
parent 182ef5d83d
commit 5c2d17fe0a

View File

@@ -0,0 +1,20 @@
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('plans', '0008_variety_seed_material'),
]
operations = [
migrations.AlterField(
model_name='ricetransplantentry',
name='installed_seedling_boxes',
field=models.DecimalField(
decimal_places=2,
max_digits=8,
verbose_name='設置苗箱枚数',
),
),
]