<?php

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

class CreatePrestasisTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
     public function up()
    {
        Schema::create('t_prestasi', function (Blueprint $table) {
            $table->increments('id');
            $table->string('jenis_prestasi');
            $table->string('nama_prestasi');
            $table->string('tahun_prestasi');
            $table->string('penyelenggara');
            $table->integer('id_pendaftar')->unsigned();
            $table->foreign('id_pendaftar')
                  ->references('id')->on('t_pendaftar')
                  ->onDelete('cascade');
            $table->timestamps();
        });
    }

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