Created temporary API

This commit is contained in:
Gregorio Chiko Putra
2019-05-09 14:23:17 +07:00
parent b1ab965f11
commit b0553839d0
5 changed files with 144 additions and 2 deletions

View File

@@ -0,0 +1,38 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateSiswasTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('siswas', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('nama');
$table->string('nisn');
$table->string('kelas');
$table->string('tempat_lahir');
$table->string('tanggal_lahir');
$table->boolean('lulus');
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('siswas');
}
}

View File

@@ -0,0 +1,38 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateAccessLogsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('access_logs', function (Blueprint $table) {
$table->bigIncrements('id');
$table->unsignedInteger('siswa_id');
$table->timestamps();
$table->softDeletes();
$table->foreign('siswa_id')
->on('siswas')
->onUpdate('cascade')
->onDelete('restrict');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('access_logs');
}
}