53 lines
1.9 KiB
PHP
53 lines
1.9 KiB
PHP
|
<?php
|
||
|
|
||
|
use Illuminate\Database\Migrations\Migration;
|
||
|
use Illuminate\Database\Schema\Blueprint;
|
||
|
use Illuminate\Support\Facades\Schema;
|
||
|
use Modules\CetakLabel\Entities\Directorat;
|
||
|
use Modules\CetakLabel\Entities\Job;
|
||
|
use Modules\CetakLabel\Entities\SpecialCode;
|
||
|
use Modules\CetakLabel\Entities\SubDirectorat;
|
||
|
use Modules\CetakLabel\Entities\SubJob;
|
||
|
use Modules\CetakLabel\Entities\SubSubJob;
|
||
|
|
||
|
return new class extends Migration
|
||
|
{
|
||
|
/**
|
||
|
* Run the migrations.
|
||
|
*/
|
||
|
public function up(): void
|
||
|
{
|
||
|
Schema::create('documents', function (Blueprint $table) {
|
||
|
$table->id();
|
||
|
$table->foreignIdFor(Directorat::class)->constrained()->onDelete('cascade');
|
||
|
$table->foreignIdFor(SubDirectorat::class)->constrained()->onDelete('cascade');
|
||
|
$table->foreignIdFor(Job::class)->constrained()->onDelete('cascade');
|
||
|
$table->foreignIdFor(SubJob::class)->constrained()->onDelete('cascade');
|
||
|
$table->foreignIdFor(SubSubJob::class)->constrained()->onDelete('cascade');
|
||
|
$table->foreignIdFor(SpecialCode::class)->nullable()->constrained()->onDelete('cascade');
|
||
|
$table->string('no_urut',3)->nullable();
|
||
|
$table->string('sequence',100)->nullable();
|
||
|
$table->string('kode', 15);
|
||
|
$table->string('status')->nullable();
|
||
|
$table->string('keterangan')->nullable();
|
||
|
$table->enum('jenis_dokumen',['nasabah','non nasabah'])->nullable();
|
||
|
|
||
|
$table->timestamps();
|
||
|
$table->softDeletes();
|
||
|
|
||
|
$table->unsignedBigInteger('created_by')->nullable();
|
||
|
$table->unsignedBigInteger('updated_by')->nullable();
|
||
|
$table->unsignedBigInteger('deleted_by')->nullable();
|
||
|
|
||
|
});
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Reverse the migrations.
|
||
|
*/
|
||
|
public function down(): void
|
||
|
{
|
||
|
Schema::dropIfExists('documents');
|
||
|
}
|
||
|
};
|