/* eslint-disable */
module.exports = {
  async up(queryInterface, Sequelize) {
    await queryInterface.sequelize.query(`
      ALTER TABLE falukant_data.director
      ADD COLUMN IF NOT EXISTS may_repair_vehicles boolean;
    `);
    await queryInterface.sequelize.query(`
      UPDATE falukant_data.director
      SET may_repair_vehicles = true
      WHERE may_repair_vehicles IS NULL;
    `);
    await queryInterface.sequelize.query(`
      ALTER TABLE falukant_data.director
      ALTER COLUMN may_repair_vehicles SET DEFAULT true;
    `);
    await queryInterface.sequelize.query(`
      ALTER TABLE falukant_data.director
      ALTER COLUMN may_repair_vehicles SET NOT NULL;
    `);
  },

  async down(queryInterface, Sequelize) {
    // optional rollback: drop column
    await queryInterface.sequelize.query(`
      ALTER TABLE falukant_data.director
      DROP COLUMN IF EXISTS may_repair_vehicles;
    `);
  },
};


