<?php

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

class CreateAddress extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('addresses', function (Blueprint $table) {
            $table->id();
            $table->unsignedInteger('customer_id');
            $table->string('name');
            $table->string('phone');
            $table->unsignedInteger('country_id');
            $table->unsignedInteger('zone_id');
            $table->string('zone');
            $table->unsignedInteger('city_id')->nullable();
            $table->string('city');
            $table->string('zipcode');
            $table->string('address_1');
            $table->string('address_2');
            $table->timestamps();
        });
    }

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