'use strict';

/** @type {import('sequelize-cli').Migration} */
module.exports = {
  async up (queryInterface, Sequelize) {
    // 将title字段从STRING改为TEXT以支持更长的标题
    await queryInterface.changeColumn('Articles', 'title', {
      type: Sequelize.TEXT,
      allowNull: false
    });
  },

  async down (queryInterface, Sequelize) {
    // 回滚时将title字段改回STRING
    await queryInterface.changeColumn('Articles', 'title', {
      type: Sequelize.STRING,
      allowNull: false
    });
  }
};
