20250914040554-update-article-content-to-longtext.js 542 B

1234567891011121314151617181920
  1. 'use strict';
  2. /** @type {import('sequelize-cli').Migration} */
  3. module.exports = {
  4. async up (queryInterface, Sequelize) {
  5. // 将content字段从TEXT改为LONGTEXT以支持更大的内容
  6. await queryInterface.changeColumn('Articles', 'content', {
  7. type: Sequelize.TEXT('long'),
  8. allowNull: true
  9. });
  10. },
  11. async down (queryInterface, Sequelize) {
  12. // 回滚时将content字段改回TEXT
  13. await queryInterface.changeColumn('Articles', 'content', {
  14. type: Sequelize.TEXT,
  15. allowNull: true
  16. });
  17. }
  18. };