<?php

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

class AddForeignKeyOfVilles extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        
        Schema::table('magasins', function (Blueprint $table) {
            $table->foreign('ville_id')
                ->references('id')->on('villes');
        });

        Schema::table('admins', function (Blueprint $table) {
            $table->foreign('magasin_id')
                ->references('id')->on('magasins');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
