<?php

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

class EditPropertyChannelCurrencyColumn extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        DB::statement('ALTER TABLE `property_channel` DROP FOREIGN KEY `property_channel_ibfk_2`;');

        DB::statement('
ALTER TABLE `property_channel`
MODIFY COLUMN `currency_code` varchar(250) NOT NULL AFTER `country_code`,
DROP INDEX `property_channel_currency_code_foreign`;
') ;


        DB::statement('UPDATE `property_channel` SET `currency_code` = \'["EUR", "USD", "TRY"]\';') ;
    }

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