18185a557a
美团接入店内搜索 deeplink 链路, 表加 4 列存美团侧店铺身份/原料: - meituan_poi_id_str: 分享链 302 反查出的 poi_id_str(索引) - meituan_share_url / meituan_resolved_url / meituan_deeplink: 与 taobao_* 平行 poi_id_str 不进 id_meituan: 调研实证它每次分享重新加密、非稳定主键(同店两条分享链 两个值, 见 docs §八), 单列当"可复跳的一次性票据"存; id_meituan 留给将来 CPS API 拿到的稳定数字 poi_id。4 列均纳入 upsert 填空合并集。 迁移 store_mapping_meituan_cols(down=store_mapping_table); 已 upgrade, 单 head, 模型零漂移, 合并不变式 26列=22合并+4排除 仍成立。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
40 lines
1.8 KiB
Python
40 lines
1.8 KiB
Python
"""store_mapping 加美团原料列(poi_id_str + 分享链/反查 URL/deeplink)
|
|
|
|
Revision ID: store_mapping_meituan_cols
|
|
Revises: store_mapping_table
|
|
Create Date: 2026-06-13 00:00:00.000000
|
|
|
|
美团接入店内搜索 deeplink 链路: dpurl.cn 短链 → 302 反查 poi_id_str → imeituan:// deeplink。
|
|
poi_id_str 每次分享重新加密、非稳定主键, 单列 meituan_poi_id_str 存(不占 id_meituan,
|
|
后者留给将来 CPS API 的稳定数字 poi_id)。其余三列与 taobao_* 原料列平行。
|
|
"""
|
|
from typing import Sequence, Union
|
|
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision: str = 'store_mapping_meituan_cols'
|
|
down_revision: Union[str, Sequence[str], None] = 'store_mapping_table'
|
|
branch_labels: Union[str, Sequence[str], None] = None
|
|
depends_on: Union[str, Sequence[str], None] = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
with op.batch_alter_table('store_mapping', schema=None) as batch_op:
|
|
batch_op.add_column(sa.Column('meituan_poi_id_str', sa.String(length=64), nullable=True))
|
|
batch_op.add_column(sa.Column('meituan_share_url', sa.String(length=256), nullable=True))
|
|
batch_op.add_column(sa.Column('meituan_resolved_url', sa.Text(), nullable=True))
|
|
batch_op.add_column(sa.Column('meituan_deeplink', sa.Text(), nullable=True))
|
|
batch_op.create_index(batch_op.f('ix_store_mapping_meituan_poi_id_str'), ['meituan_poi_id_str'], unique=False)
|
|
|
|
|
|
def downgrade() -> None:
|
|
with op.batch_alter_table('store_mapping', schema=None) as batch_op:
|
|
batch_op.drop_index(batch_op.f('ix_store_mapping_meituan_poi_id_str'))
|
|
batch_op.drop_column('meituan_deeplink')
|
|
batch_op.drop_column('meituan_resolved_url')
|
|
batch_op.drop_column('meituan_share_url')
|
|
batch_op.drop_column('meituan_poi_id_str')
|