osb/database/migrations/2018_07_10_034223_users_add_language.php
2018-07-10 13:42:17 +10:00

38 lines
942 B
PHP

<?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');
});
}
}