Files
competition-website/database/migrations/018-add-test-flag-to-contestants.js
WorkBuddy a303cf2d53 chore: 后端首次基线提交
运行必须源码:app/(controller/model/service/middleware/lib/utils/validate/router)、config/、database/(migrations/seeders/sql)、启动脚本、app/public/templates 模板。
已忽略运行非必须:node_modules/、logs/、run/、app/public 运行时上传数据、.env*、构建/缓存产物。
2026-08-17 12:25:42 +08:00

23 lines
595 B
JavaScript
Raw Permalink 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';
/**
* 迁移文件:为 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');
},
};