<?php

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

class CreateRegionableTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('regionable', function (Blueprint $table) {
            $table->id();

            $table->foreignId('region_id')
                ->constrained('regions','id')
                ->onDelete('CASCADE');

            $table->morphs('regionable');

            $table->enum('status_provide',\Mehrab\Region\Models\Region::$status_PROVIDE)
                ->default(\Mehrab\Region\Models\Region::ACTIVE_PROVIDE);

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

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