<?php

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

class CreatePropertyAvailabilityType extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {

        DB::statement("
              CREATE TABLE `property_availability_type` (
              `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
              `name` varchar(250) COLLATE utf8mb4_unicode_ci NOT NULL,
              `language_key` varchar(250) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
              `code` varchar(5) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
              `status` tinyint(3) unsigned 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`),
              FOREIGN KEY (`created_by`) REFERENCES `user` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
              FOREIGN KEY (`updated_by`) REFERENCES `user` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
            );

        ") ;


        DB::statement("INSERT INTO `property_availability_type` VALUES
            (1,'Room Availability',NULL,'ROM',1,1,1,1,1),
            (2,'Limited',NULL,'LMT',1,1,1,1,1),
            (3,'Guaranteed',NULL,'GRT',1,1,1,1,1)
            ;");

    }

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