'use strict'; /** * 将已存在的“主体管理”菜单 component 由占位页 views/Generic.vue * 修正为真实页面 views/Principal/Index.vue(前端已实现主体列表管理页)。 * 幂等:仅当 component 仍为占位页时才更新。 */ module.exports = { async up(queryInterface) { const sequelize = queryInterface.sequelize; await sequelize.query( `UPDATE menus SET component = ? WHERE name = ? AND path = ? AND type = 2 AND component = ?`, { replacements: [ 'views/Principal/Index.vue', '主体管理', '/system/principal', 'views/Generic.vue', ], } ); }, async down(queryInterface) { const sequelize = queryInterface.sequelize; await sequelize.query( `UPDATE menus SET component = ? WHERE name = ? AND path = ? AND type = 2`, { replacements: ['views/Generic.vue', '主体管理', '/system/principal'], } ); }, };