'use strict'; module.exports = app => { const { BIGINT, DATE } = app.Sequelize; const StockStaticNotice = app.model.define('stock_static_notice', { id: { type: BIGINT(20).UNSIGNED, primaryKey: true, autoIncrement: true, comment: '主键ID', }, stock_id: { type: BIGINT(20).UNSIGNED, allowNull: false, comment: '商品ID,关联 wms_stock_warehouse.id', }, notice_time: { type: DATE, allowNull: false, comment: '通知时间', }, created_at: { type: DATE, allowNull: false, comment: '创建时间', }, updated_at: { type: DATE, allowNull: false, comment: '更新时间', }, deleted_at: { type: DATE, defaultValue: null, comment: '软删除时间', }, }, { tableName: 'wms_stock_static_notice', freezeTableName: true, timestamps: false, paranoid: true, comment: '静态商品通知关联表(记录静态商品已通知时间,避免重复通知)', indexes: [ { name: 'idx_stock_notice_time', fields: [ 'stock_id', 'notice_time' ], }, { name: 'idx_notice_time', fields: [ 'notice_time' ], }, ], }); return StockStaticNotice; };