<?php

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

class CreateCrawlersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        //
        Schema::create('crawlers', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name')->nullable();
            $table->integer('price')->default(0);
            $table->integer('size')->nullable();
            $table->string('address')->nullable();
            $table->text('desc')->nullable();
            $table->string('phone')->nullable();
            $table->string('date_expire')->nullable();
            $table->string('lat')->nullable();
            $table->string('lng')->nullable();
            $table->string('source');
            $table->timestamps();

        });

        Schema::create('crawler_images', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('image')->nullable();
            $table->integer('crawler_id')->nullable();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
        Schema::dropIfExists('crawlers');
        Schema::dropIfExists('crawler_images');
    }
}
