- 移除后端产品、目的地、活动专题等废弃模块的数据库表与业务代码,删除冗余API接口 - 删除小程序端详情页、线路组件等冗余代码,移除搜索工具与测试用例,调整导航逻辑 - 清理管理端废弃的类型定义、编辑器与测试代码 - 更新项目文档,修正模块维护说明与接口文档内容
43 lines
1.3 KiB
Python
43 lines
1.3 KiB
Python
"""Add route section configuration.
|
|
|
|
Revision ID: 0004_route_sections
|
|
Revises: 0003_campaign_display_fields
|
|
Create Date: 2026-07-02
|
|
"""
|
|
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
from sqlalchemy import inspect
|
|
|
|
|
|
revision = "0004_route_sections"
|
|
down_revision = "0003_campaign_display_fields"
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
bind = op.get_bind()
|
|
existing_tables = set(inspect(bind).get_table_names())
|
|
|
|
if "RouteSection" not in existing_tables:
|
|
op.create_table(
|
|
"RouteSection",
|
|
sa.Column("id", sa.String(), nullable=False),
|
|
sa.Column("title", sa.String(), nullable=False),
|
|
sa.Column("subtitle", sa.Text(), nullable=True),
|
|
sa.Column("sortOrder", sa.Integer(), nullable=False, server_default="0"),
|
|
sa.Column("isActive", sa.Boolean(), nullable=False, server_default=sa.true()),
|
|
sa.Column("createdAt", sa.DateTime(), nullable=False),
|
|
sa.Column("updatedAt", sa.DateTime(), nullable=False),
|
|
sa.PrimaryKeyConstraint("id"),
|
|
)
|
|
|
|
|
|
|
|
def downgrade() -> None:
|
|
bind = op.get_bind()
|
|
existing_tables = set(inspect(bind).get_table_names())
|
|
if "RouteSection" in existing_tables:
|
|
op.drop_table("RouteSection")
|