<?php

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

class AddBookingidForeignkeyToChinabankslipTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('china_bank_slips', function($table)
        {
            $table->integer('booking_id')->unsigned()->nullable();
            $table->foreign('booking_id')->references('id')->on('bookings');
        });
    }

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