26 lines
776 B
JavaScript
26 lines
776 B
JavaScript
'use strict';
|
||
|
||
const TABLE_NAME = 'wms_inbound_direct_log';
|
||
|
||
module.exports = {
|
||
up: async (queryInterface, Sequelize) => {
|
||
const tables = await queryInterface.showAllTables();
|
||
const exists = tables.some(t => (typeof t === 'string' ? t : t.tableName) === TABLE_NAME);
|
||
if (!exists) return;
|
||
|
||
const columns = await queryInterface.describeTable(TABLE_NAME);
|
||
if (columns.space_id) return;
|
||
|
||
await queryInterface.addColumn(TABLE_NAME, 'space_id', {
|
||
type: Sequelize.BIGINT(20).UNSIGNED,
|
||
allowNull: true,
|
||
defaultValue: null,
|
||
comment: '存放库位ID,关联 wms_location_space.id;为空时 commit 默认使用 1',
|
||
});
|
||
},
|
||
|
||
down: async queryInterface => {
|
||
await queryInterface.removeColumn(TABLE_NAME, 'space_id');
|
||
},
|
||
};
|