'use strict'; module.exports = app => { const { BIGINT, DATE } = app.Sequelize; const StockStaticCheckTask = app.model.define('stock_static_check_task', { 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', }, task_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_check_task', freezeTableName: true, timestamps: false, paranoid: true, comment: '静态商品盘点任务关联表(记录是否已为静态商品创建盘点任务,避免重复创建)', indexes: [ { name: 'idx_stock_task_time', fields: [ 'stock_id', 'task_time' ], }, { name: 'idx_task_time', fields: [ 'task_time' ], }, ], }); return StockStaticCheckTask; };