<?php

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

class AddColumnRoomBedType extends Migration
{
    public function up()
    {
        Schema::table('property_room_bed_type', function (Blueprint $table) {
            $table->string('icon',30)->after('name')->nullable();
        });

        DB::connection()->statement("UPDATE property_room_bed_type SET icon = '1.png'  WHERE id = 1");
        DB::connection()->statement("UPDATE property_room_bed_type SET icon = '1.png'  WHERE id = 2");
        DB::connection()->statement("UPDATE property_room_bed_type SET icon = '1.png'  WHERE id = 3");
        DB::connection()->statement("UPDATE property_room_bed_type SET icon = '1.png'  WHERE id = 4");
        DB::connection()->statement("UPDATE property_room_bed_type SET icon = '1.png'  WHERE id = 5");
        DB::connection()->statement("UPDATE property_room_bed_type SET icon = '1.png'  WHERE id = 6");
        DB::connection()->statement("UPDATE property_room_bed_type SET icon = '1.png'  WHERE id = 7");
        DB::connection()->statement("UPDATE property_room_bed_type SET icon = '1.png'  WHERE id = 8");
    }


    public function down()
    {
        Schema::table('property_room_bed_type', function (Blueprint $table) {
            $table->dropColumn('icon');
        });
    }
}
