mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-10 19:41:07 +03:30
41 lines
1.2 KiB
PHP
41 lines
1.2 KiB
PHP
<?php
|
|
|
|
use App\Constants\StatusTypeEnum;
|
|
use Illuminate\Support\Facades\Schema;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Database\Migrations\Migration;
|
|
|
|
class CreateTransfersTable extends Migration
|
|
{
|
|
/**
|
|
* Run the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function up()
|
|
{
|
|
Schema::create('transfers', function (Blueprint $table) {
|
|
$table->bigIncrements('id');
|
|
$table->unsignedBigInteger('item_id');
|
|
$table->foreign('item_id')->references('id')->on('items');
|
|
$table->unsignedBigInteger('user_id');
|
|
$table->foreign('user_id')->references('id')->on('users');
|
|
$table->dateTime('from_date')->nullable();
|
|
$table->dateTime('to_date')->nullable();
|
|
$table->enum( 'status' , [ StatusTypeEnum::APPROVED , StatusTypeEnum::REJECTED , StatusTypeEnum::PENDING ] )->default( StatusTypeEnum::PENDING );
|
|
$table->timestamps();
|
|
$table->softDeletes();
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function down()
|
|
{
|
|
Schema::dropIfExists('transfers');
|
|
}
|
|
}
|