<?php

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

class CreateUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {

        if (!Schema::hasTable('users')) {
            Schema::create('users', function (Blueprint $table) {
                $table->id();
                $table->integer('role_id')->index()->unsigned()->nullable();
                $table->integer('is_active')->default(0);
                $table->string('name')->nullable();
                $table->string('name_ar')->nullable();
                $table->string('name_en')->nullable();
                $table->longText('photo')->nullable();
                $table->longText('phone')->nullable();
                $table->string('email')->unique()->nullable();
                $table->timestamp('email_verified_at')->nullable();
                $table->string('password')->nullable();
                $table->longText('pio_ar')->nullable();
                $table->longText('pio_en')->nullable();
                $table->longText('job_title_ar')->nullable();
                $table->longText('job_title_en')->nullable();
                $table->boolean('is_notifiy')->default(1);
                $table->string('password_show')->nullable();
                $table->rememberToken();
                $table->timestamps();
            });
        }
    }

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