<?php

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

class CreateUserBankSlipsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('user_bank_slips', function (Blueprint $table) {
            $table->increments('id');
            $table->string('bank_slip_type')->nullable();
            $table->string('bankslip_url')->nullable();
            $table->double('transfer_amount')->nullable();
            $table->string('cust_marking')->nullable();
            $table->integer('booking_id')->unsigned();
            $table->foreign('booking_id')->references('id')->on('bookings');

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

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('user_bank_slips', function(Blueprint $table)
        {
            $table->dropForeign('user_bank_slips_id_foreign');
        });

        Schema::dropIfExists('user_bank_slips');
    }
}
