Writeoff/Database/Migrations/2023_11_06_101550_create_debitur_table.php

45 lines
1.5 KiB
PHP
Raw Normal View History

2023-11-13 12:13:33 +00:00
<?php
2023-11-15 08:04:25 +00:00
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
2023-11-13 12:13:33 +00:00
use Modules\Writeoff\Entities\Branch;
2023-11-15 08:04:25 +00:00
return new class extends Migration {
/**
* Run the migrations.
*/
public function up()
: void
{
Schema::create('debitur', function (Blueprint $table) {
$table->id();
$table->foreignIdFor(Branch::class)->constrained()->onDelete('cascade');
$table->string('kode', 6)->unique();
$table->string('name');
$table->date('registered_at')->nullable();
$table->text('address')->nullable();
$table->string('npwp', 16)->nullable();
$table->boolean('status')->default(true)->nullable();
$table->timestamps();
$table->timestamp('authorized_at')->nullable();
$table->char('authorized_status', 1)->nullable();
$table->softDeletes();
2023-11-13 12:13:33 +00:00
2023-11-15 08:04:25 +00:00
$table->unsignedBigInteger('created_by')->nullable();
$table->unsignedBigInteger('updated_by')->nullable();
$table->unsignedBigInteger('deleted_by')->nullable();
$table->unsignedBigInteger('authorized_by')->nullable();
});
}
2023-11-13 12:13:33 +00:00
2023-11-15 08:04:25 +00:00
/**
* Reverse the migrations.
*/
public function down()
: void
{
Schema::dropIfExists('debitur');
}
};