// app/model/order_wave_strategy_match.js 'use strict'; module.exports = app => { const { BIGINT, INTEGER, DATE } = app.Sequelize; const OrderWaveStrategyMatch = app.model.define('wms_order_wave_strategy_match', { id: { type: BIGINT, primaryKey: true, autoIncrement: true, allowNull: false, comment: '主键', }, warehouse_id: { type: INTEGER(10), allowNull: false, comment: '仓库ID', }, order_id: { type: BIGINT, allowNull: false, comment: '订单ID,逻辑关联分仓主表,不做物理外键', }, strategy_id: { type: INTEGER(10), allowNull: false, comment: '命中的波次策略ID', }, create_time: { type: DATE, allowNull: false, defaultValue: app.Sequelize.literal('CURRENT_TIMESTAMP'), comment: '写入时间', }, }, { tableName: 'wms_order_wave_strategy_match', timestamps: false, comment: '订单波次策略命中明细表,记录每个订单命中的全部策略', indexes: [ { name: 'idx_warehouse_order', fields: [ 'warehouse_id', 'order_id' ], }, { name: 'idx_warehouse_strategy', fields: [ 'warehouse_id', 'strategy_id' ], }, ], }); return OrderWaveStrategyMatch; };