45 lines
1.2 KiB
PHP
45 lines
1.2 KiB
PHP
|
<?php
|
||
|
|
||
|
use Illuminate\Support\Facades\Schema;
|
||
|
use Illuminate\Database\Schema\Blueprint;
|
||
|
use Illuminate\Database\Migrations\Migration;
|
||
|
|
||
|
return new class extends Migration
|
||
|
{
|
||
|
/**
|
||
|
* Run the migrations.
|
||
|
*
|
||
|
* @return void
|
||
|
*/
|
||
|
public function up()
|
||
|
{
|
||
|
Schema::create('approvals', function (Blueprint $table) {
|
||
|
$table->id();
|
||
|
$table->string("method", 50);
|
||
|
$table->string('model', 50);
|
||
|
$table->json('new_request')->nullable();
|
||
|
$table->json('old_request')->nullable();
|
||
|
$table->string("description", 255)->nullable();
|
||
|
$table->string('status', 1)->default(0)->nullable();
|
||
|
$table->timestamps();
|
||
|
$table->timestamp('approved_at')->nullable();
|
||
|
$table->softDeletes();
|
||
|
|
||
|
$table->unsignedBigInteger('created_by')->nullable();
|
||
|
$table->unsignedBigInteger('updated_by')->nullable();
|
||
|
$table->unsignedBigInteger('deleted_by')->nullable();
|
||
|
$table->unsignedBigInteger('approved_by')->nullable();
|
||
|
});
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Reverse the migrations.
|
||
|
*
|
||
|
* @return void
|
||
|
*/
|
||
|
public function down()
|
||
|
{
|
||
|
Schema::dropIfExists('approvals');
|
||
|
}
|
||
|
};
|