<?php

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

class CreateRepresentativeTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('representative', function (Blueprint $table) {
            $table->string('id')->primary();
            $table->string('identification')->unique('representative_identification_unique');
            $table->string('firstname', 45);
            $table->string('lastname', 45);
            $table->string('age', 45);
            $table->enum('gender', ['f', 'm', 'o']);
            $table->string('email', 45)->nullable();
            $table->string('phone', 45);
            $table->text('address');
            $table->dateTime('birthday')->nullable();
            $table->enum('blood_type', ['a+', 'a-', 'b+', 'b-', 'o+', 'o-', 'ab+', 'ab-'])->nullable();
            $table->timestamp('created_at')->useCurrent();
            $table->timestamp('updated_at')->nullable();
        });
    }

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