'use strict'; /** * 扩展 wms_user_oauth.login_code 长度:64 → 128。 * * 原因:login_code 为 {uuid, id_6} JSON 的 base64,长度约 96 字符, * 原 VARCHAR(64) 写入时报 Data too long。 */ const TABLE_NAME = 'wms_user_oauth'; module.exports = { async up(queryInterface, Sequelize) { const { STRING } = Sequelize; await queryInterface.changeColumn(TABLE_NAME, 'login_code', { type: STRING(128), allowNull: true, comment: '登录码({uuid,id_6} JSON 的 base64,一次性消费)', }); }, async down(queryInterface, Sequelize) { const { STRING } = Sequelize; await queryInterface.changeColumn(TABLE_NAME, 'login_code', { type: STRING(64), allowNull: true, comment: '登录码(前缀+随机,64位,全局唯一)', }); }, };