Files
exchange/database/migrations/2018_05_15_075453_create_bookings_table.php
T
2018-07-04 10:56:43 +08:00

55 lines
1.4 KiB
PHP

<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateBookingsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('bookings', function (Blueprint $table) {
$table->increments('id');
$table->string('account_name');
$table->integer('account_num');
$table->string('bank_name');
$table->string('bank_branch');
$table->string('company_name');
$table->string('company_address');
$table->string('bank_address');
$table->string('swift_code');
$table->string('cnap');
$table->string('term');
$table->double('amount');
$table->unsignedInteger('rate_id');
$table->foreign('rate_id')
->references('id')->on('rates')
->onDelete('cascade');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('bookings', function(Blueprint $table)
{
$table->dropForeign('bookings_rate_id_foreign');
$table->dropColumn('rate_id');
});
Schema::dropIfExists('bookings');
}
}