You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

31 lines
723 B

<?php
use Movim\Migration;
use Illuminate\Database\Schema\Blueprint;
class AddNicknameToUsersTable extends Migration
{
public function up()
{
$this->disableForeignKeyCheck();
$this->schema->table('users', function (Blueprint $table) {
$table->string('nickname', 64)->nullable();
$table->unique('nickname');
});
$this->enableForeignKeyCheck();
}
public function down()
{
$this->disableForeignKeyCheck();
$this->schema->table('users', function (Blueprint $table) {
$table->dropUnique('users_nickname_unique');
$table->dropColumn('nickname');
});
$this->enableForeignKeyCheck();
}
}