WMS_MAIN/database/migrations/20260617150000-make-warehouse-id-nullable-in-wms-platfrom-setting.js
liufumingren d743e67b9d 1
2026-06-17 01:18:55 +08:00

21 lines
600 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

'use strict';
module.exports = {
async up(queryInterface, Sequelize) {
await queryInterface.changeColumn('wms_platfrom_setting', 'warehouse_id', {
type: Sequelize.BIGINT.UNSIGNED,
allowNull: true,
comment: '仓库ID,NULL表示系统级设置',
});
},
async down(queryInterface, Sequelize) {
// 回滚前需确认没有 warehouse_id=NULL 的数据,否则回滚会失败
await queryInterface.changeColumn('wms_platfrom_setting', 'warehouse_id', {
type: Sequelize.BIGINT.UNSIGNED,
allowNull: false,
comment: '仓库ID',
});
},
};