'use strict';
/** @type {import('sequelize-cli').Migration} */
module.exports = {
  async up (queryInterface, Sequelize) {
    await queryInterface.createTable('halls', {
      hall_id: {
        allowNull: false,
        autoIncrement: true,
        primaryKey: true,
        type: Sequelize.DataTypes.INTEGER
      },
      hall_name: {
        type: Sequelize.DataTypes.STRING(100),
        allowNull: false,
        comment: 'Название зала'
      },
      capacity: {
        type: Sequelize.DataTypes.INTEGER,
        allowNull: true,
        defaultValue: 5,
        comment: 'Вместимость'
      },
      hourly_rate: {
        type: Sequelize.DataTypes.DECIMAL(10, 2),
        allowNull: false,
        comment: 'Ставка в час'
      },
      description: {
        type: Sequelize.DataTypes.TEXT,
        allowNull: true,
        comment: 'Описание зала'
      },
      is_active: {
        type: Sequelize.DataTypes.BOOLEAN,
        allowNull: true,
        defaultValue: true,
        comment: 'Активен ли зал'
      }
    })
  },
  async down (queryInterface, Sequelize) {
    await queryInterface.dropTable('halls')
  }
}