WMS_MAIN/database/migrations/20261010100000-add-created-at-index-to-wms-return-unpack.js
liufumingren e9e39eafa7 chore: 提交工作区其余未提交改动(微信协议版本 / 扫描报文接口 / container 模型 / 退件 like 数组)
- 微信开放平台:首次授权时写入系统默认用户须知作为首个协议版本
  (ctx.service.systems.wechat.ensureDefaultAgreementVersion),含 seed / backfill 两个迁移
- 新增扫描报文接收接口 POST /scan:把「时间 + 条码」追加写入项目根目录 scan_records.xlsx
  (串行队列 + 原子写,避免并发写坏文件)
- 新增 wms_container(容器/笼筐)模型与建表迁移
- 退件收货单 / 退件运单列表:like 查询条件支持字符串数组(多关键词 OR)
- 新增 wms_return_unpack.created_at 索引迁移
- package.json:deploy 脚本改名为 depeeloy

注:scan_records.xlsx 是 /scan 接口写入的运行时数据文件,未纳入本次提交。
2026-10-16 05:29:13 +08:00

21 lines
730 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

'use strict';
/**
* wms_return_unpack 补充登记时间索引。
* 看板 fulfillment 今日拆包件数按 warehouse_id + created_at 今日范围计数,
* 原表仅有 (warehouse_id, unpack_date) 等索引,按登记时间过滤会退化为
* 全表扫描,新增 (warehouse_id, created_at) 复合索引使范围过滤走索引
* (对齐 wms_return_received 的 idx_warehouse_created_at)。
*/
module.exports = {
async up(queryInterface) {
await queryInterface.addIndex('wms_return_unpack', [ 'warehouse_id', 'created_at' ], {
name: 'idx_warehouse_created_at',
});
},
async down(queryInterface) {
await queryInterface.removeIndex('wms_return_unpack', 'idx_warehouse_created_at');
},
};