<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;


class UpdateFactAtrributeAndUnitTables extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        DB::statement("
        ALTER TABLE `property_fact_attribute` ADD COLUMN `giata_id` int(11) NULL DEFAULT NULL AFTER `order_number`;
        ALTER TABLE `property_fact_attribute` MODIFY COLUMN `unit_id` int(10) UNSIGNED NULL DEFAULT 0 AFTER `language_key`; 
        ALTER TABLE `property_fact_attribute` MODIFY COLUMN `type` tinyint(4) NULL DEFAULT 0 AFTER `unit_id`;
        ALTER TABLE `property_fact_attribute` MODIFY COLUMN `order_number` tinyint(4) NULL DEFAULT 0 AFTER `type`;
        ALTER TABLE `property_unit` ADD COLUMN `giata_id` int(11) NULL DEFAULT NULL AFTER `short_name`;
        ALTER TABLE `property_unit` ADD COLUMN `status` tinyint(1) NOT NULL AFTER `giata_id`;
        ");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
