WMS_MAIN/database/migrations/20260923170000-method-doc-payload-column.js

26 lines
889 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';
/**
* 方法文档表增加 payload 列(2026-09-23):
* 原始条目含 status/notes/requestBody 等扩展字段,结构化列无法覆盖。
* payload 存整个 method 条目的原始 JSON 文本,导入/导出按原文无损往返;
* 结构化列(method/module/group_name/description/is_need_login/is_need_auth/headers/params/response/errors)
* 仅用于检索过滤,导出优先使用 payload。
*/
const DOC_TABLE = 'wms_api_method_doc';
module.exports = {
async up(queryInterface, Sequelize) {
await queryInterface.addColumn(DOC_TABLE, 'payload', {
type: Sequelize.TEXT('long'),
allowNull: true,
comment: 'method 条目完整 JSON 文本(含 status/notes/requestBody 等扩展字段,无损往返用)',
});
},
async down(queryInterface) {
await queryInterface.removeColumn(DOC_TABLE, 'payload');
},
};