<?php

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

class AddressTable extends Migration
{
    const TABLE = 'table_address';

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create(self::TABLE, function (Blueprint $table) {
            $table->increments('id');

            $table->uuid('uuid')->nullable();

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

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

            $table->string('country_title')->nullable();
            $table->string('country_code')->nullable();

            $table->string('street_title')->nullable();
            $table->string('street_number')->nullable();
            $table->string('full_string')->nullable();

            $table->string('google_place_id')->nullable();
            $table->boolean('migrated')->default(false);

            $table->double('lat', 11, 8)->nullable();
            $table->double('lng', 11, 8)->nullable();

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

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