This commit is contained in:
11
scripts/migration/config/main_test_dsn.yaml
Normal file
11
scripts/migration/config/main_test_dsn.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
# 新系统 PostgreSQL 测试库连接配置(只读)
|
||||
# 脚本仅用它做"测试环境 id 探测",生成的线上 SQL 不会硬编码这些 id
|
||||
# 实际使用时复制为 main_test_dsn.yaml(已 .gitignore)
|
||||
|
||||
host: "cxd.whcxd.cn"
|
||||
port: 16159
|
||||
user: "erp_pgsql"
|
||||
password: "erp_2025"
|
||||
database: "junhong_cmp_test"
|
||||
sslmode: "disable"
|
||||
connect_timeout: 10
|
||||
47
scripts/migration/config/mapping.yaml.example
Normal file
47
scripts/migration/config/mapping.yaml.example
Normal file
@@ -0,0 +1,47 @@
|
||||
# 奇成迁移映射配置(单文件)
|
||||
# 复制为 mapping.yaml 后使用,会被 scan_legacy.py 自动增量补全
|
||||
#
|
||||
# 工作流:
|
||||
# 1. 业务方提供 resources/cards.csv(只需 iccid 列)
|
||||
# 2. python3 scan_legacy.py → 自动从奇成扫描元数据,把发现的 carrier/package/agent 补到本文件
|
||||
# 3. 人工填写所有 target_* 字段
|
||||
# 4. python3 migrate_assets.py / migrate_runtime.py 正常出 SQL
|
||||
|
||||
# ============== 全局配置 ==============
|
||||
# 迁移操作者(creator/updater/operator_id),通常是后台超级管理员账号 ID
|
||||
# 上线前确认: SELECT id FROM tb_account WHERE login_account = 'admin' LIMIT 1;
|
||||
migration_user_id: 0
|
||||
|
||||
# 本次迁移批次号。线上每次迁移必须使用独立批次,用于导入后收尾、验收和回滚定位。
|
||||
migration_batch_no: "MIGRATION-QICHENG-YYYYMMDD"
|
||||
|
||||
# ============== 运营商映射 ==============
|
||||
# scan_legacy 会按"奇成 tbl_card.category"分组写入,你只需填 target_*
|
||||
carriers:
|
||||
- legacy_category: 9
|
||||
legacy_category_name: "中国联通"
|
||||
target_carrier_id: null # 必填:新库 tb_carrier.id
|
||||
target_carrier_type: null # 必填:CMCC / CUCC / CTCC / CBN
|
||||
target_carrier_name: null # 必填:新库 carrier_name 快照
|
||||
|
||||
# ============== 套餐映射 ==============
|
||||
# scan_legacy 会按"奇成 tbl_card_life.meal_id"分组写入
|
||||
packages:
|
||||
- legacy_meal_id: "D6554244711498752"
|
||||
legacy_meal_name: "三网充电宝全国畅玩年卡套餐1000G/月(12个月)"
|
||||
target_package_id: null # 必填:新库 tb_package.id
|
||||
|
||||
# ============== 套餐系列映射(可选) ==============
|
||||
# 仅当你需要给迁移卡设置 tb_iot_card.series_id 时才填
|
||||
series:
|
||||
- legacy_series_id: "95A038B9D3014F9DA1539EC092D9DBAA"
|
||||
legacy_series_name: "国内卡 无预存30天"
|
||||
target_series_id: null # 可选:新库 tb_package_series.id,null=不写入
|
||||
|
||||
# ============== 代理-店铺映射 ==============
|
||||
# scan_legacy 会按"奇成 tbl_card.agent_id"分组写入,你只需填 target_shop_code
|
||||
# 留空(null)的代理:其卡进平台库存(除非 cards.csv 里显式指定 target_shop_code)
|
||||
agents:
|
||||
- legacy_agent_id: "D15EC779767B412A82B8448AC2324F04"
|
||||
legacy_agent_name: "叶发伟"
|
||||
target_shop_code: null # 新库 tb_shop.shop_code,null=不归任何店铺
|
||||
Reference in New Issue
Block a user