<?php

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

class AddColumnToTableDeliveryInfo extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('deliveryinfos', function (Blueprint $table) {
            
             $table->unsignedInteger('com_id');//FK wrn id
             $table->foreign('com_id')
                   ->references('id')->on('companies')
                   ->onDelete('cascade');
   
        });
    }

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