Merge branch 'hugo-shipping-notice' into dev
# Conflicts: # frontend/src/features/chat/components/ChatViewContent.vue
This commit is contained in:
commit
80d78130f8
121 files changed
+9621
-1263
No files matched your search
@@ -0,0 +1,54 @@
|
||||
"""customer odm scope: add odm_ids to shipping_customers
|
||||
|
||||
Revision ID: aa11bb22cc33
|
||||
Revises: fb26bc033d27
|
||||
Create Date: 2026-09-16 00:00:00.000000
|
||||
|
||||
"""
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
revision = "aa11bb22cc33"
|
||||
down_revision = "fb26bc033d27"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def _add_column(insp, table: str, column: sa.Column) -> None:
|
||||
if table not in set(insp.get_table_names()):
|
||||
return
|
||||
columns = {col["name"] for col in insp.get_columns(table)}
|
||||
if column.name not in columns:
|
||||
with op.batch_alter_table(table, schema=None) as batch_op:
|
||||
batch_op.add_column(column)
|
||||
|
||||
|
||||
def _drop_column(insp, table: str, name: str) -> None:
|
||||
if table not in set(insp.get_table_names()):
|
||||
return
|
||||
columns = {col["name"] for col in insp.get_columns(table)}
|
||||
if name in columns:
|
||||
with op.batch_alter_table(table, schema=None) as batch_op:
|
||||
batch_op.drop_column(name)
|
||||
|
||||
|
||||
def upgrade():
|
||||
insp = sa.inspect(op.get_bind())
|
||||
_add_column(
|
||||
insp,
|
||||
"shipping_customers",
|
||||
sa.Column("odm_ids", sa.JSON(), nullable=True),
|
||||
)
|
||||
_add_column(
|
||||
insp,
|
||||
"shipping_notice_line_inventory_matches",
|
||||
sa.Column("chosen_odm_id", sa.String(length=64), nullable=True),
|
||||
)
|
||||
|
||||
|
||||
def downgrade():
|
||||
insp = sa.inspect(op.get_bind())
|
||||
_drop_column(insp, "shipping_notice_line_inventory_matches", "chosen_odm_id")
|
||||
_drop_column(insp, "shipping_customers", "odm_ids")
|
||||
@@ -0,0 +1,25 @@
|
||||
"""merge migration heads
|
||||
|
||||
用途:合并平行迁移分支,恢复 Alembic 单 head 链。
|
||||
依赖:无表结构操作,仅声明多父级(aa11bb22cc33 客户 ODM 字段 × vc6a7b8c9d0e 凭证检核通知配置)。
|
||||
逻辑:hugo-shipping-notice 与 dev 两侧各自新增迁移产生分叉;本 Revision 只做图合并,
|
||||
upgrade/downgrade 均为空操作,实际 DDL 由两个父迁移各自负责。
|
||||
|
||||
Revision ID: dd22ee33ff44
|
||||
Revises: aa11bb22cc33, vc6a7b8c9d0e
|
||||
Create Date: 2026-09-17 00:00:00.000000
|
||||
|
||||
"""
|
||||
|
||||
revision = "dd22ee33ff44"
|
||||
down_revision = ("aa11bb22cc33", "vc6a7b8c9d0e")
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
pass
|
||||
|
||||
|
||||
def downgrade():
|
||||
pass
|
||||
Reference in new issue
Block a user