'use strict';
const { defaultKeys, migrationDefaults, relationShip } = require('../sequelize/defaults');
/** @type {import('sequelize-cli').Migration} */
module.exports = {
  async up(queryInterface, Sequelize) {
    await queryInterface.createTable('settings', {
      ...defaultKeys("setting_id"),
      branch_id: relationShip({
        modelName: "branches",
        key: "branch_id",
        allowNull: false,
      }),
      setting_name: {
        type: Sequelize.STRING,
        allowNull: false,
      },
      setting_desc: {
        type: Sequelize.TEXT(),
        allowNull: true,
      },
      setting_type: {
        type: Sequelize.ENUM(["PRIVACY_AND_POLICY", "TERMS_AND_CONDITIONS", "GENDRAL_INFROMATION", "ABOUT_US", "CONTACT_US"]),
        allowNull: false,
      },
      ...migrationDefaults()
    });
  },
  async down(queryInterface, Sequelize) {
    await queryInterface.dropTable('settings');
  }
};