<?php

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

class CreatePropertyWebPhotoMapping extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        DB::statement("
                    CREATE TABLE `property_web_photo_mapping`  (
                      `id` bigint(20) NOT NULL AUTO_INCREMENT,
                      `property_id` int(11) UNSIGNED NOT NULL,
                      `property_web_id` bigint(11) UNSIGNED NOT NULL,
                      `property_photo_id` bigint(20) UNSIGNED NOT NULL,
                      `is_cover` tinyint(1) NOT NULL DEFAULT 0,
                      `status` tinyint(1) NOT NULL DEFAULT 0,
                      `created_by` int(11) UNSIGNED NOT NULL,
                      `updated_by` int(11) 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`),
                      FOREIGN KEY (`property_web_id`) REFERENCES `property_web` (`id`),
                      FOREIGN KEY (`property_photo_id`) REFERENCES `property_photo` (`id`)
                    );

        ");
    }

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