<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class SupplierBookingTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('supplier_bookings', function (Blueprint $table) {
            $table->increments('id');
            $table->string('payment_method');
            $table->double('transfer_amount');
            $table->double('rate');
            $table->double('rebate');
            $table->double('amountInRMB');
            $table->double('rmbBankAmount');

            $table->integer('booking_id')->unsigned();
            $table->foreign('booking_id')->references('id')->on('bookings');

            $table->integer('supplier_id')->unsigned();
            $table->foreign('supplier_id')->references('id')->on('setting_suppliers');

            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('supplier_bookings');
    }
}
