'use strict';

/** @type {import('sequelize-cli').Migration} */
module.exports = {
  async up(queryInterface, Sequelize) {
    await queryInterface.addColumn('tour_pages', 'background_video_autoplay', {
      type: Sequelize.BOOLEAN,
      allowNull: false,
      defaultValue: true,
    });
    await queryInterface.addColumn('tour_pages', 'background_video_loop', {
      type: Sequelize.BOOLEAN,
      allowNull: false,
      defaultValue: true,
    });
    await queryInterface.addColumn('tour_pages', 'background_video_muted', {
      type: Sequelize.BOOLEAN,
      allowNull: false,
      defaultValue: true,
    });
    await queryInterface.addColumn('tour_pages', 'background_video_start_time', {
      type: Sequelize.DECIMAL(10, 1),
      allowNull: true,
      defaultValue: null,
    });
    await queryInterface.addColumn('tour_pages', 'background_video_end_time', {
      type: Sequelize.DECIMAL(10, 1),
      allowNull: true,
      defaultValue: null,
    });
  },

  async down(queryInterface, _Sequelize) {
    await queryInterface.removeColumn('tour_pages', 'background_video_autoplay');
    await queryInterface.removeColumn('tour_pages', 'background_video_loop');
    await queryInterface.removeColumn('tour_pages', 'background_video_muted');
    await queryInterface.removeColumn('tour_pages', 'background_video_start_time');
    await queryInterface.removeColumn('tour_pages', 'background_video_end_time');
  },
};
