- 更新前后端 sign_contract_sxsy80.pdf - 增加 com-sxsy80 说明、数据迁移与 SQL/执行脚本 - 增加 com-xsj33 数据迁移说明与 docs 下合同源文件 Made-with: Cursor
60 lines
2.0 KiB
Markdown
60 lines
2.0 KiB
Markdown
# 公司名称:太原树英商贸
|
||
|
||
## mysql数据库配置信息
|
||
|
||
host ip: 106.14.132.80
|
||
datasource:
|
||
name: yangtangyoupin
|
||
username: yangtangyoupin
|
||
password: 5Fn8eWrbYFtAhCZw
|
||
|
||
## 数据清理任务
|
||
|
||
- **数据范围**:用户 id 集(`wa_users`)
|
||
`92566,92801,92839,93004,92637,92965,93093,93096,93116,92787,93121,93129,92884,93007,93020,93094,93099,93110,92638`
|
||
|
||
- 保留wa_users表中id在用户id数据范围的 ,删除其余用户数据
|
||
- 保留eb_user表中uid在用户id数据范围的 ,删除其余用户数据
|
||
|
||
- wa_order
|
||
清空wa_order表中数据
|
||
|
||
- wa_merchandise
|
||
只保留“created_at >= 2026-04-24”并且seller_id或buyer_id在用户id数据范围的寄售商品,删除其余数据
|
||
(当前库表字段为 `user_id` 表示卖家,实现时按 `user_id` 与日期条件过滤。)
|
||
|
||
- wa_selfbonus_log
|
||
只保留 `user_id` 在用户id数据范围内的记录,删除其余数据
|
||
|
||
- wa_sharebonus_log
|
||
只保留 `user_id` 在用户id数据范围内的记录,删除其余数据
|
||
|
||
- wa_coupon_log
|
||
只保留 `user_id` 在用户id数据范围内的记录,删除其余数据
|
||
|
||
- wa_withdraw
|
||
清空wa_withdraw表中数据
|
||
|
||
- eb_store_order
|
||
清空eb_store_order表中数据
|
||
|
||
- eb_user_integral_record
|
||
只保留用户在名单内的记录;表字段为 `uid`(与 `wa_users.id` / `eb_user.uid` 对应),实现按 `uid` 过滤。
|
||
|
||
## 执行脚本
|
||
|
||
- SQL:`docs/sql/com-sxsy80-data-cleanup.sql`
|
||
- 本机 Homebrew `mysql` 9 客户端不支持 `mysql_native_password`,可用 `pip install pymysql` 后执行:
|
||
|
||
```bash
|
||
export YTYP_DB_PASSWORD='(见上文 datasource.password)'
|
||
python3 docs/sql/run_com_sxsy80_cleanup.py
|
||
```
|
||
|
||
- 已于 **2026-04-26** 对远程库执行并成功 `COMMIT`(`wa_merchandise` 删除 2114 行,`wa_selfbonus_log` 1592,`wa_sharebonus_log` 1399,`wa_coupon_log` 171,`eb_user_integral_record` 1613,`eb_user` 80,`wa_users` 80;`wa_order` / `wa_withdraw` / `eb_store_order` 已 `TRUNCATE`)。
|
||
|
||
## 相关文件
|
||
|
||
- 源数据dump文件: 'integral-shop/db/ccd-yangtangyoupin_2026-04-26_10-25-01_mysql_data.sql'
|
||
|