Cetaklabel/Database/Migrations/2023_07_06_130223_create_approvals_table.php

45 lines
1.2 KiB
PHP
Raw Normal View History

2023-07-21 09:37:19 +00:00
<?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');
}
};