'use strict'; /** * 用户须知版本表去掉 version 数字版本号,直接用 id 自增(2026-09-23): * - 删除唯一索引 uk_appid_version(appid,version); * - 删除 version 列;最新版本判定改为 ORDER BY id DESC。 */ const TABLE_NAME = 'wms_wechat_agreement_version'; module.exports = { async up(queryInterface) { await queryInterface.removeIndex(TABLE_NAME, 'uk_appid_version'); await queryInterface.removeColumn(TABLE_NAME, 'version'); }, async down(queryInterface, Sequelize) { await queryInterface.addColumn(TABLE_NAME, 'version', { type: Sequelize.INTEGER, allowNull: true, defaultValue: null, comment: '协议版本号(数字,同一 appid 内自动+1)', }); await queryInterface.addIndex(TABLE_NAME, [ 'appid', 'version' ], { unique: true, name: 'uk_appid_version', }); }, };