<?php

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

class CreateOrangtuaTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('t_orangtua', function (Blueprint $table) {
            $table->increments('id');
            $table->string('nama_ayah')->nullable();
            $table->date('tahun_lahir_ayah')->nullable();
            $table->string('nik_ayah')->nullable();
            $table->string('kebutuhan_khus_ayah')->nullable();
            $table->string('pekerjaan_ayah')->nullable();
            $table->string('pendidikan_ayah')->nullable();
            $table->string('penghasilan_bulanan_ayah')->nullable();
            $table->string('nama_ibu')->nullable();
            $table->date('tahun_lahir_ibu')->nullable();
            $table->string('nik_ibu')->nullable();
            $table->string('kebutuhan_khus_ibu')->nullable();
            $table->string('pekerjaan_ibu')->nullable();
            $table->string('pendidikan_ibu')->nullable();
            $table->string('penghasilan_bulanan_ibu')->nullable();
            $table->string('nama_wali')->nullable();
            $table->string('tahun_lahir_wali')->nullable();
            $table->string('nik_wali')->nullable();
            $table->string('kebutuhan_khus_wali')->nullable();
            $table->string('pekerjaan_wali')->nullable();
            $table->string('pendidikan_wali')->nullable();
            $table->string('penghasilan_bulanan_wali')->nullable();
            $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_orangtua');
    }
}
