<?php

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

class CreateTableAsalsekolah extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
       Schema::create('t_asalsekolah', function (Blueprint $table) {
            $table->increments('id');
            $table->string('nama_sekolah');
            $table->string('alamat_sekolah');
            $table->string('nisn');
            $table->string('nik');
            $table->string('no_ijazah');
            $table->string('no_skhun');
            $table->string('no_ujiannasional');

            $table->integer('id_pendaftar')->unsigned();
            $table->foreign('id_pendaftar')
                  ->references('id')->on('t_pendaftar')
                  ->onDelete('cascade');
            $table->softDeletes();
            $table->timestamps();
        });
    }

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