mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-11 22:01:05 +03:30
40 lines
1.1 KiB
PHP
40 lines
1.1 KiB
PHP
<?php
|
|
|
|
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', ['approved','rejected','suspended'])->default('suspended');
|
|
$table->timestamps();
|
|
$table->softDeletes();
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function down()
|
|
{
|
|
Schema::dropIfExists('transfers');
|
|
}
|
|
}
|