<?php

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

class Estudiantes extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */

    public function up()
    {
        Schema::create('Estudiantes', function (Blueprint $table) {
            $table->bigincrements('IdEstudiante');
            $table->string('Cedula',12)->unique();
            $table->string('Apellido1',100);
            $table->string('Apellido2',100);
            $table->string('nombre',100);
            $table->string('telefono',20);
            $table->string('email',50)->unique();
            $table->string('Direccion',250)->nullable();
            $table->string('Genero',10);
            $table->string('Seccion',5)->nullable();
            $table->datetime('FechaSolicitud');
            $table->boolean('Aprobado');
            $table->datetime('FechaAprobado');
            $table->boolean('Eliminado');
            $table->unsignedBigInteger('idtipousuario');
            $table->string('foto',250)->nullable();
            $table->foreign('idtipousuario')->references('id')->on('tipousuario')->onUpdate('restrict')->onDelete('restrict');
            $table->rememberToken();
            $table->timestamps();

        });
    }

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