1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?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');
}
}