Files
exchange-2.0/database/migrations/2020_12_02_060758_create_bookings_table.php
T
CheeSiong c3f153fe4b Create Booking Logic Class
Update Booking Logic Class
 Delete Booking Logic Class
2020-12-04 09:49:47 +08:00

47 lines
1.7 KiB
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateBookingsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('bookings', function (Blueprint $table) {
$table->id();
$table->bigInteger('company_id')->unsigned()->nullable();
$table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade');
$table->bigInteger('transferable_bank_id')->unsigned()->nullable();
$table->foreign('transferable_bank_id')->references('id')->on('company_banks')->onDelete('cascade');
$table->string('marking');
$table->string('reference');
$table->float('fix_amount', 20, 5)->nullable();
$table->bigInteger('fix_currency_id')->unsigned()->nullable();
$table->foreign('fix_currency_id')->references('id')->on('currencies')->onDelete('cascade');
$table->bigInteger('convertible_currency_id')->unsigned()->nullable();
$table->foreign('convertible_currency_id')->references('id')->on('currencies')->onDelete('cascade');
$table->bigInteger('conversion_currency_id')->unsigned()->nullable();
$table->foreign('conversion_currency_id')->references('id')->on('currencies')->onDelete('cascade');
$table->integer('status')->default(1);
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('bookings');
}
}