29 lines
992 B
Python
29 lines
992 B
Python
from django.db import migrations, models
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
|
('wpm', '0132_mlogbw_tooling_alter_mlogbw_equip'),
|
|
]
|
|
|
|
operations = [
|
|
migrations.SeparateDatabaseAndState(
|
|
database_operations=[
|
|
# Column already exists in DB; ensure it has a server-side default
|
|
# so INSERT statements that omit the column don't violate NOT NULL.
|
|
migrations.RunSQL(
|
|
sql="ALTER TABLE wpm_mlogbw ALTER COLUMN pre_info SET DEFAULT '{}'::jsonb",
|
|
reverse_sql="ALTER TABLE wpm_mlogbw ALTER COLUMN pre_info DROP DEFAULT",
|
|
),
|
|
],
|
|
state_operations=[
|
|
migrations.AddField(
|
|
model_name='mlogbw',
|
|
name='pre_info',
|
|
field=models.JSONField(blank=True, default=dict, verbose_name='预处理信息'),
|
|
),
|
|
],
|
|
),
|
|
]
|