<?php

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

class UsersAddLanguage extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('users', function (Blueprint $table) {
			$table->integer('language_id')->nullable();
			$table->foreign('language_id')->references('id')->on('ab_language');
			$table->integer('currency_id')->nullable();
			$table->foreign('currency_id')->references('id')->on('ab_currency');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('users', function (Blueprint $table) {
			$table->dropForeign(['language_id']);
			$table->dropColumn('language_id');
			$table->dropForeign(['currency_id']);
			$table->dropColumn('currency_id');
        });
    }
}