20250918071151-add-top-position-to-articles.js 450 B

1234567891011121314151617
  1. 'use strict';
  2. /** @type {import('sequelize-cli').Migration} */
  3. module.exports = {
  4. async up (queryInterface, Sequelize) {
  5. await queryInterface.addColumn('articles', 'topPosition', {
  6. type: Sequelize.INTEGER,
  7. allowNull: true,
  8. defaultValue: 0,
  9. comment: '是否置顶,0-不置顶,1-置顶'
  10. });
  11. },
  12. async down (queryInterface, Sequelize) {
  13. await queryInterface.removeColumn('articles', 'topPosition');
  14. }
  15. };