'use strict'; /** * 迁移文件:为 contestants 表添加 test_flag 字段 * 用于区分测试数据和生产数据,防止重置操作误删生产数据 */ module.exports = { up: async (queryInterface, Sequelize) => { const { INTEGER } = Sequelize; await queryInterface.addColumn('contestants', 'test_flag', { type: INTEGER, allowNull: false, defaultValue: 0, comment: '测试数据标记:0=生产数据,1=测试数据', }); }, down: async (queryInterface) => { await queryInterface.removeColumn('contestants', 'test_flag'); }, };