mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
43 lines
1.2 KiB
PHP
43 lines
1.2 KiB
PHP
<?php
|
|
|
|
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->integer('owner_id')->nullable();
|
|
$table->integer('owner_type')->nullable();
|
|
$table->string('document_type')->nullable();
|
|
$table->string('reference')->nullable();
|
|
$table->integer('status')->nullable();
|
|
$table->bigInteger('approved_by')->unsigned()->nullable();
|
|
$table->foreign('approved_by')->references('id')->on('users')->onDelete('cascade');
|
|
$table->timestamp('issued_date')->nullable();
|
|
$table->timestamp('expired_date')->nullable();
|
|
$table->timestamp('approved_date')->nullable();
|
|
$table->timestamps();
|
|
$table->softDeletes();
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function down()
|
|
{
|
|
Schema::dropIfExists('documents');
|
|
}
|
|
}
|