60 lines
1.3 KiB
JavaScript
60 lines
1.3 KiB
JavaScript
'use strict';
|
|
|
|
module.exports = app => {
|
|
const { BIGINT, STRING, DATE } = app.Sequelize;
|
|
|
|
const PrintTaskMap = app.model.define('PrintTaskMap', {
|
|
id: {
|
|
type: BIGINT.UNSIGNED,
|
|
primaryKey: true,
|
|
autoIncrement: true,
|
|
allowNull: false,
|
|
comment: '主键ID',
|
|
},
|
|
task_code: {
|
|
type: STRING(128),
|
|
allowNull: false,
|
|
comment: '打印任务编码',
|
|
},
|
|
print_record_id: {
|
|
type: BIGINT.UNSIGNED,
|
|
allowNull: true,
|
|
comment: '关联打印记录ID',
|
|
},
|
|
provider: {
|
|
type: STRING(64),
|
|
allowNull: true,
|
|
comment: 'provider返回任务ID或标识',
|
|
},
|
|
created_at: {
|
|
type: DATE,
|
|
allowNull: false,
|
|
defaultValue: app.Sequelize.literal('CURRENT_TIMESTAMP'),
|
|
comment: '创建时间',
|
|
},
|
|
}, {
|
|
tableName: 'wms_print_task_map',
|
|
freezeTableName: true,
|
|
underscored: false,
|
|
timestamps: false,
|
|
comment: '打印任务唯一映射表',
|
|
indexes: [
|
|
{
|
|
name: 'uix_task_code',
|
|
unique: true,
|
|
fields: [ 'task_code' ],
|
|
},
|
|
{
|
|
name: 'idx_print_record_id',
|
|
fields: [ 'print_record_id' ],
|
|
},
|
|
{
|
|
name: 'idx_created_at',
|
|
fields: [ 'created_at' ],
|
|
},
|
|
],
|
|
});
|
|
|
|
return PrintTaskMap;
|
|
};
|