<?php

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

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

        DB::statement("
CREATE TABLE `property_nonrefundable`  (
  `id` bigint(0) NOT NULL AUTO_INCREMENT,
  `property_id` int(0) UNSIGNED NOT NULL,
  `channel_id` int(0) UNSIGNED NOT NULL,
  `channel_mapping_id` int(0) UNSIGNED NOT NULL,
  `room_rate_mapping_id` bigint(0) UNSIGNED NOT NULL,
  `action_type` varchar(10) NOT NULL,
  `value_type` varchar(10) NOT NULL,
  `value` double(10, 2) NOT 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`),
  FOREIGN KEY (`property_id`) REFERENCES `property` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  FOREIGN KEY (`channel_id`) REFERENCES `property_channel` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  FOREIGN KEY (`channel_mapping_id`) REFERENCES `property_channel_mapping` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  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
);
        ");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */

}
