const { Sequelize } = require("sequelize");

module.exports = {
  async up(queryInterface) {
    await queryInterface.createTable("section", {
      ID_SECTION: {
        type: Sequelize.UUID,
        primaryKey: true,
        defaultValue: Sequelize.UUIDV4,
        allowNull: false,
      },
      NAME_SECTION: {
        type: Sequelize.STRING(100),
        allowNull: false,
      },
      DESCRIPTION_SECTION: {
        type: Sequelize.TEXT,
        allowNull: true,
      },
      THUMBNAIL: {
        type: Sequelize.STRING(255),
        allowNull: true,
      },
      IS_DELETED: {
        type: Sequelize.TINYINT(1),
        allowNull: true,
        defaultValue: 0,
      },
      TIME_SECTION: {
        type: Sequelize.DATE,
        allowNull: true,
        defaultValue: Sequelize.NOW,
      },
    });
  },

  async down(queryInterface) {
    await queryInterface.dropTable("section");
  },
};
