<?php

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

class CreateUserShopsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('user_shops', function (Blueprint $table) {

            $table->increments('id');
            $table->unsignedInteger('user_id');

            $table->string('url', 255)->nullable();

            $table->string('name', 255)->nullable();
            $table->text('description')->nullable();
            $table->text('about_you')->nullable();
            $table->text('user_address')->nullable();

            $table->text('trans')->nullable();

            $table->boolean('pick_up')->default(true);
            $table->boolean('active')->default(false);
            $table->timestamp('active_date')->nullable();

            $table->string('featured')->nullable();

            $table->timestamps();
            $table->softDeletes();

            $table->foreign('user_id')
                ->references('id')
                ->on('users')
                ->onDelete('cascade');
        });
    }

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