"use strict"; module.exports = app => { const { INTEGER, BIGINT, STRING, DATE, TINYINT } = app.Sequelize; const PrintStationExpress = app.model.define('print_station_express', { id: { type: INTEGER.UNSIGNED, autoIncrement: true, primaryKey: true, comment: '自增主键ID', }, print_station_id: { type: STRING(32), allowNull: false, comment: '打印台ID,关联wms_print_stations表的print_station_id', }, express_id: { type: STRING(32), allowNull: false, comment: '快递ID', }, express_name: { type: STRING(50), allowNull: false, comment: '快递名称,冗余字段,便于查询', }, printer_name: { type: STRING(100), allowNull: false, comment: '绑定的打印机名称', }, creator_id: { type: BIGINT.UNSIGNED, allowNull: false, comment: '创建人工号ID', }, creator_name: { type: STRING(50), allowNull: false, comment: '创建人名称', }, create_at: { type: DATE, allowNull: false, comment: '创建时间', }, update_at: { type: DATE, allowNull: false, comment: '更新时间', }, deleted: { type: TINYINT, allowNull: false, defaultValue: 0, comment: '软删除标记:0-未删除,1-已删除', }, }, { tableName: 'wms_print_station_express', freezeTableName: true, underscored: false, timestamps: false, indexes: [ { unique: true, name: 'uk_print_station_express', fields: ['print_station_id', 'express_id', 'deleted'], }, { name: 'idx_print_station_id', fields: ['print_station_id'], }, { name: 'idx_express_id', fields: ['express_id'], }, { name: 'idx_creator_id', fields: ['creator_id'], }, ], comment: '打印台快递-打印机绑定关系表', }); return PrintStationExpress; };