<?php

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

class CreateKartuTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('t_kartu', function (Blueprint $table) {
            $table->increments('id');
            $table->string('status')->nullable();
            $table->integer('id_pendaftar')->unsigned();
            $table->foreign('id_pendaftar')
                  ->references('id')->on('t_pendaftar')
                  ->onDelete('cascade');
            $table->softDeletes();
            $table->timestamps();
        });
    }

    public function down()
    {
        Schema::dropIfExists('t_asalsekolah');
    }
}
