39948-vm/backend/src/db/migrations/20260403000001-add-background-video-settings.js
2026-04-14 13:17:31 +04:00

54 lines
1.5 KiB
JavaScript

'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',
);
},
};