<?php

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

class CreateStudentsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('students', function (Blueprint $table) {
            $table->increments('id');
            $table->string('code', 10);
            $table->string('gender', 5);
            $table->string('title', 10);
            $table->string('firstname');
            $table->string('lastname');
            $table->string('nickname');
            $table->string('idcard', 20);
            $table->date('birthdate');
            $table->string('race');
            $table->string('nationality');
            $table->string('religion');
            $table->string('address')->nullable();
            $table->string('district')->nullable();
            $table->string('amphoe')->nullable();
            $table->string('province')->nullable();
            $table->string('phone_1', 10);
            $table->string('phone_2', 10)->nullable();
            $table->string('emergency_name')->nullable();
            $table->string('emergency_phone')->nullable();
            $table->string('license_status');
            $table->boolean('is_active');
            $table->string('know_school')->nullable();
            $table->date('register_date');
            $table->timestamps();
        });
    }

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