add my package section

This commit is contained in:
mahdi purHosseini
2023-10-23 13:02:51 +03:30
parent 19d7439781
commit 644adb6528
11 changed files with 378 additions and 90 deletions
@@ -0,0 +1,51 @@
<?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();
});
}
}