20250225033944-create-article.js 716 B

1234567891011121314151617181920212223242526272829303132
  1. 'use strict';
  2. /** @type {import('sequelize-cli').Migration} */
  3. module.exports = {
  4. async up(queryInterface, Sequelize) {
  5. await queryInterface.createTable('Articles', {
  6. id: {
  7. allowNull: false,
  8. autoIncrement: true,
  9. primaryKey: true,
  10. type: Sequelize.INTEGER
  11. },
  12. title: {
  13. type: Sequelize.STRING,
  14. allowNull:false
  15. },
  16. content: {
  17. type: Sequelize.TEXT
  18. },
  19. createdAt: {
  20. allowNull: false,
  21. type: Sequelize.DATE
  22. },
  23. updatedAt: {
  24. allowNull: false,
  25. type: Sequelize.DATE
  26. }
  27. });
  28. },
  29. async down(queryInterface, Sequelize) {
  30. await queryInterface.dropTable('Articles');
  31. }
  32. };