This commit is contained in:
2026-02-12 22:34:13 +08:00
parent 78ff3d41c7
commit 6c664d912b
2 changed files with 23 additions and 0 deletions

View File

View File

@@ -0,0 +1,23 @@
# Generated by Django 6.0.1 on 2026-02-12 14:33
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('shop', '0028_fix_goodsid_schema'),
]
operations = [
# 1. 将 product_name 字段改为可为空
migrations.RunSQL(
sql="ALTER TABLE shop_order ALTER COLUMN product_name DROP NOT NULL;",
reverse_sql="ALTER TABLE shop_order ALTER COLUMN product_name SET NOT NULL;"
),
# 2. 将 unit_price 字段改为可为空
migrations.RunSQL(
sql="ALTER TABLE shop_order ALTER COLUMN unit_price DROP NOT NULL;",
reverse_sql="ALTER TABLE shop_order ALTER COLUMN unit_price SET NOT NULL;"
),
]