2017_05_17_020516_create_table_pribadi.php 1.44 KB
<?php

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

class CreateTablePribadi extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('t_pendaftar', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('user_id')->unsigned()->index();
            $table->foreign('user_id')
                  ->references('id')->on('users')
                  ->onDelete('cascade');
            $table->integer('thnajaran_id')->unsigned()->nullable();
            $table->foreign('thnajaran_id')
                  ->references('id')->on('t_tahunajaran')
                  ->onDelete('cascade');
            $table->string('no_pendaftar')->index();
            $table->string('nama');
            $table->string('jeniskelamin');
            $table->string('tempatlahir');
            $table->date('tanggallahir');
            $table->string('agama');
            $table->string('alamat');
            $table->string('kebutuhan_khusus');
            $table->string('no_tlp_rumah');
            $table->string('status')->nullable();
            $table->softDeletes();  
            $table->timestamps();
        });
    }

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