<?php

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

class CreateMembersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('members', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->unsignedBigInteger('user_id')->nullable();
            $table->string('member_name')->nullable();
            $table->string('father_name')->nullable();
            $table->string('mother_name')->nullable();
            $table->string('present_address')->nullable();
            $table->string('permanent_address')->nullable();
            $table->string('profession')->nullable();
            $table->string('birth_of_date')->nullable();
            $table->string('nationality')->nullable();
            $table->string('professional_address')->nullable();
            $table->string('member_phone')->unique()->nullable();
            $table->string('nid_no')->unique()->nullable();
            $table->string('member_photo')->nullable();
            $table->string('nomini_name')->nullable();
            $table->string('nomini_father_name')->nullable();
            $table->string('nomini_mother_name')->nullable();
            $table->string('nomini_present_address')->nullable();
            $table->string('nomini_permanent_address')->nullable();
            $table->string('nomini_profession')->nullable();
            $table->string('nomini_birth_of_date')->nullable();
            $table->string('nomini_nationality')->nullable();
            $table->string('nomini_professional_address')->nullable();
            $table->string('nomini_phone')->unique()->nullable();
            $table->string('relation')->nullable();
            $table->string('nomini_nid_no')->unique()->nullable();
            $table->string('nomini_photo')->nullable();
            $table->boolean('status')->default(true);
            $table->foreign('user_id')->references('id')->on('users')->onUpdate('cascade')->onDelete('cascade');
            $table->timestamps();
        });
    }

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