<?php

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

class CreateProfessorsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('professors', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('num_prof', 16);
            $table->string('first_name');
            $table->string('last_name');
            $table->string('system_name');
            $table->string('email')->nullable();
            $table->enum('type', ['plantilla', 'contrato', 'ta'])->nullable();
            $table->unsignedBigInteger('dept_id')->default(0);

            $table->foreign('dept_id')->references('id')->on('departments');
        });
    }

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