mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
44 lines
1.2 KiB
PHP
44 lines
1.2 KiB
PHP
<?php
|
|
|
|
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
class CreateDocumentsTable extends Migration
|
|
{
|
|
/**
|
|
* Run the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function up()
|
|
{
|
|
Schema::create('documents', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->morphs('owner');
|
|
$table->string('document_type');
|
|
$table->string('reference');
|
|
$table->integer('status')->default(ApprovalStatus::PENDING_VERIFICATION);
|
|
$table->timestamp('issued_date')->nullable();
|
|
$table->timestamp('expired_date')->nullable();
|
|
$table->foreignId('approver')->nullable()->unsigned();
|
|
$table->timestamp('approval_date')->nullable();
|
|
$table->softDeletes();
|
|
$table->timestamps();
|
|
|
|
$table->foreign('approver')->references('id')->on('users');
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function down()
|
|
{
|
|
Schema::dropIfExists('documents');
|
|
}
|
|
}
|