"use strict";

module.exports = {
  up: (queryInterface, Sequelize) => {
    return Promise.all([
      queryInterface.addColumn("RealEstates", "numberOfRooms", {
        type: Sequelize.REAL
      }),
      queryInterface.addColumn("RealEstates", "numberOfFloors", {
        type: Sequelize.INTEGER
      }),
      queryInterface.addColumn("RealEstates", "floor", {
        type: Sequelize.INTEGER
      }),
      queryInterface.addColumn("RealEstates", "accessRoadType", {
        type: Sequelize.TEXT
      }),
      queryInterface.addColumn("RealEstates", "heatingType", {
        type: Sequelize.TEXT
      }),
      queryInterface.addColumn("RealEstates", "furnishingType", {
        type: Sequelize.TEXT
      }),
      queryInterface.addColumn("RealEstates", "balcony", {
        type: Sequelize.BOOLEAN
      }),
      queryInterface.addColumn("RealEstates", "newBuilding", {
        type: Sequelize.BOOLEAN
      }),
      queryInterface.addColumn("RealEstates", "elevator", {
        type: Sequelize.BOOLEAN
      }),
      queryInterface.addColumn("RealEstates", "water", {
        type: Sequelize.BOOLEAN
      }),
      queryInterface.addColumn("RealEstates", "electricity", {
        type: Sequelize.BOOLEAN
      }),
      queryInterface.addColumn("RealEstates", "drainageSystem", {
        type: Sequelize.BOOLEAN
      }),
      queryInterface.addColumn("RealEstates", "registeredInZkBooks", {
        type: Sequelize.BOOLEAN
      }),
      queryInterface.addColumn("RealEstates", "recentlyAdapted", {
        type: Sequelize.BOOLEAN
      }),
      queryInterface.addColumn("RealEstates", "parking", {
        type: Sequelize.BOOLEAN
      }),
      queryInterface.addColumn("RealEstates", "garage", {
        type: Sequelize.BOOLEAN
      }),
      queryInterface.addColumn("RealEstates", "gas", {
        type: Sequelize.BOOLEAN
      }),
      queryInterface.addColumn("RealEstates", "antiTheftDoor", {
        type: Sequelize.BOOLEAN
      }),
      queryInterface.addColumn("RealEstates", "airCondition", {
        type: Sequelize.BOOLEAN
      }),
      queryInterface.addColumn("RealEstates", "phoneConnection", {
        type: Sequelize.BOOLEAN
      }),
      queryInterface.addColumn("RealEstates", "cableTV", {
        type: Sequelize.BOOLEAN
      }),
      queryInterface.addColumn("RealEstates", "internet", {
        type: Sequelize.BOOLEAN
      }),
      queryInterface.addColumn("RealEstates", "basementAttic", {
        type: Sequelize.BOOLEAN
      }),
      queryInterface.addColumn("RealEstates", "storeRoom", {
        type: Sequelize.BOOLEAN
      }),
      queryInterface.addColumn("RealEstates", "videoSurveillance", {
        type: Sequelize.BOOLEAN
      }),
      queryInterface.addColumn("RealEstates", "alarm", {
        type: Sequelize.BOOLEAN
      }),
      queryInterface.addColumn("RealEstates", "suitableForStudents", {
        type: Sequelize.BOOLEAN
      }),
      queryInterface.addColumn("RealEstates", "includingBills", {
        type: Sequelize.BOOLEAN
      }),
      queryInterface.addColumn("RealEstates", "animalsAllowed", {
        type: Sequelize.BOOLEAN
      }),
      queryInterface.addColumn("RealEstates", "pool", {
        type: Sequelize.BOOLEAN
      }),
      queryInterface.addColumn("RealEstates", "exchange", {
        type: Sequelize.BOOLEAN
      }),
      queryInterface.addColumn("RealEstates", "urbanPlanPermit", {
        type: Sequelize.BOOLEAN
      }),
      queryInterface.addColumn("RealEstates", "buildingPermit", {
        type: Sequelize.BOOLEAN
      }),
      queryInterface.addColumn("RealEstates", "utilityConnection", {
        type: Sequelize.BOOLEAN
      }),
      queryInterface.addColumn("RealEstates", "distanceToRiver", {
        type: Sequelize.INTEGER
      }),
      queryInterface.addColumn("RealEstates", "numberOfViewsAgency", {
        type: Sequelize.INTEGER,
        defaultValue: 0
      }),
      queryInterface.addColumn("RealEstates", "numberOfViewsKivi", {
        type: Sequelize.INTEGER,
        defaultValue: 0
      })
    ]);
  },

  down: (queryInterface, Sequelize) => {
    return Promise.all([
      queryInterface.removeColumn("RealEstates", "numberOfRooms"),
      queryInterface.removeColumn("RealEstates", "numberOfFloors"),
      queryInterface.removeColumn("RealEstates", "floor"),
      queryInterface.removeColumn("RealEstates", "accessRoadType"),
      queryInterface.removeColumn("RealEstates", "heatingType"),
      queryInterface.removeColumn("RealEstates", "furnishingType"),
      queryInterface.removeColumn("RealEstates", "balcony"),
      queryInterface.removeColumn("RealEstates", "newBuilding"),
      queryInterface.removeColumn("RealEstates", "elevator"),
      queryInterface.removeColumn("RealEstates", "water"),
      queryInterface.removeColumn("RealEstates", "electricity"),
      queryInterface.removeColumn("RealEstates", "drainageSystem"),
      queryInterface.removeColumn("RealEstates", "registeredInZkBooks"),
      queryInterface.removeColumn("RealEstates", "recentlyAdapted"),
      queryInterface.removeColumn("RealEstates", "parking"),
      queryInterface.removeColumn("RealEstates", "garage"),
      queryInterface.removeColumn("RealEstates", "gas"),
      queryInterface.removeColumn("RealEstates", "antiTheftDoor"),
      queryInterface.removeColumn("RealEstates", "airCondition"),
      queryInterface.removeColumn("RealEstates", "phoneConnection"),
      queryInterface.removeColumn("RealEstates", "cableTV"),
      queryInterface.removeColumn("RealEstates", "internet"),
      queryInterface.removeColumn("RealEstates", "basementAttic"),
      queryInterface.removeColumn("RealEstates", "storeRoom"),
      queryInterface.removeColumn("RealEstates", "videoSurveillance"),
      queryInterface.removeColumn("RealEstates", "alarm"),
      queryInterface.removeColumn("RealEstates", "suitableForStudents"),
      queryInterface.removeColumn("RealEstates", "includingBills"),
      queryInterface.removeColumn("RealEstates", "animalsAllowed"),
      queryInterface.removeColumn("RealEstates", "pool"),
      queryInterface.removeColumn("RealEstates", "exchange"),
      queryInterface.removeColumn("RealEstates", "urbanPlanPermit"),
      queryInterface.removeColumn("RealEstates", "buildingPermit"),
      queryInterface.removeColumn("RealEstates", "utilityConnection"),
      queryInterface.removeColumn("RealEstates", "distanceToRiver"),
      queryInterface.removeColumn("RealEstates", "numberOfViewsAgency"),
      queryInterface.removeColumn("RealEstates", "numberOfViewsKivi")
    ]);
  }
};
