mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-10 19:41:07 +03:30
52 lines
1.6 KiB
PHP
52 lines
1.6 KiB
PHP
<?php
|
|
|
|
use Illuminate\Support\Facades\Schema;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Database\Migrations\Migration;
|
|
|
|
class UpdateTransfersTable extends Migration
|
|
{
|
|
/**
|
|
* Run the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function up()
|
|
{
|
|
Schema::dropIfExists( 'transfers' );
|
|
Schema::create('transfers', function (Blueprint $table) {
|
|
$table->bigIncrements('id');
|
|
$table->morphs( 'transferable' );
|
|
$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' );
|
|
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();
|
|
});
|
|
}
|
|
}
|