<?php

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

class CreateProfileUserTable extends Migration
{


    public $set_schema_table = 'profile_user';

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {

        Schema::table($this->set_schema_table, function($table) {
            $table->create();
            $table->increments('id');
            $table->integer('profile_id')->nullable()->unsigned();
            $table->integer('user_id')->nullable()->unsigned();


            $table->foreign('user_id')->references('id')->on('users')->onDelete('set null');
            $table->foreign('profile_id')->references('id')->on('profiles')->onDelete('set null');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
