<?php

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

class CreateStoresTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('stores', function (Blueprint $table) {
            $table->id();
            $table->integer('package_id');
            $table->integer('area_id');
            $table->integer('station_id');

            $table->string('name');
            $table->string('slug')->nullable();
            $table->mediumText('address')->nullable();
            $table->string('phone_number')->nullable();
            $table->string('email')->nullable();
            $table->string('title')->nullable();
            $table->mediumText('description')->nullable();

            $table->mediumText('other_request')->nullable();
            $table->string('open_time')->nullable();
            $table->string('working_time')->nullable();
            $table->string('latitude')->nullable();
            $table->string('longitude')->nullable();
            $table->mediumText('near')->nullable();
            $table->double('rating', 5, 2)->nullable();
            $table->string('thumbnail')->nullable();

            $table->string('origin_thumb')->nullable();
            $table->mediumText('website')->nullable();
            $table->mediumText('original_link')->nullable();
            $table->string('refer_id')->nullable();

            $table->string('seo_title')->nullable();
            $table->string('seo_robots')->nullable();
            $table->string('seo_keywords')->nullable();
            $table->string('seo_description')->nullable();

            $table->smallInteger('is_amp')->default(1);
            $table->smallInteger('is_activated')->default(1);
            $table->smallInteger('is_deleted')->default(0);
            $table->timestamps();
        });
    }

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