<?php

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

class CreateBookingStatusTable extends Migration
{

    public function up()
    {
        DB::statement("DROP TABLE IF EXISTS `booking_status`;");
        DB::statement("

        CREATE TABLE `booking_status`  (
          `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
          `name` varchar(200)  NOT NULL,
          `language_key` varchar(255)  NULL DEFAULT NULL,
          `status` tinyint(4) NOT NULL DEFAULT 1,
          `created_by` int(10) UNSIGNED NOT NULL,
          `updated_by` int(10) UNSIGNED NOT NULL,
          `created_at` int(11) NOT NULL,
          `updated_at` int(11) NOT NULL,
          PRIMARY KEY (`id`) USING BTREE,
          INDEX `property_type_created_by_foreign`(`created_by`) USING BTREE,
          INDEX `property_type_updated_by_foreign`(`updated_by`) USING BTREE
        )


        ");

        DB::statement("INSERT INTO `booking_status` VALUES
            (1, 'Booking', 'enw-channels-channel_setup-booking-title', 1, 1, 1, 1, 1),
            (2, 'Prebooking', 'enw-reservation-prebooking', 1, 1, 1, 1, 1);
        ") ;

        DB::statement("INSERT INTO `booking_status` VALUES
            (0, 'Cancel/Refund', 'enw-payment_transaction-status-cancel_refund', 1, 1, 1, 1, 1);
        ") ;

        DB::statement("UPDATE`booking_status` SET id = 0 WHERE id = 3 ;");


    }


    public function down()
    {
        //
    }
}
