<?php

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

class CreateTablePropertyWebLogTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        DB::statement("
         CREATE TABLE `property_web_log` (
        `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
        `web_id` bigint(20) unsigned NOT NULL,
        `ip` int(10) unsigned NOT NULL,
        `country_code` varchar(4) NOT NULL,
        `device_type` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
        `status` tinyint(3) unsigned NOT NULL DEFAULT '1',
        `created_at` int(11) NOT NULL,
        `updated_at` int(11) NOT NULL,
        PRIMARY KEY (`id`),
        FOREIGN KEY ( `web_id` ) REFERENCES `property_web` ( `id` ) ON DELETE RESTRICT ON UPDATE RESTRICT,
        FOREIGN KEY ( `country_code` ) REFERENCES `ip_nation_countries` ( `code` ) ON DELETE RESTRICT ON UPDATE RESTRICT
        )
       ");
    }

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

    }
}
