<?php

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

class CreateCustomersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('customers', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('user_id');
            $table->string('customer_id', 50);
            $table->string('customer_name', 50);
            $table->string('company', 50)->nullable();
            $table->string('address', 300);
            $table->string('mobile', 20)->unique();
            $table->string('email', 50)->unique();
            $table->integer('gender');
            $table->integer('category');
            $table->string('referred_by', 50)->nullable();
            $table->integer('created_by');
            $table->timestamps();
        });
    }

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