Fix migration

This commit is contained in:
Pig Fang 2018-08-21 10:58:10 +08:00
parent f3fab514a5
commit 313bc50103
4 changed files with 48 additions and 9 deletions

View File

@ -23,7 +23,6 @@ class CreateAllTables extends Migration
$table->integer('permission')->default('0');
$table->dateTime('last_sign_at');
$table->dateTime('register_at');
$table->rememberToken();
});
Schema::create('closets', function (Blueprint $table) {

View File

@ -0,0 +1,41 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddRememberTokenToUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('users', function (Blueprint $table) {
$table->rememberToken();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('users', function (Blueprint $table) {
if (config('database.default') == 'sqlite') {
// Dropping columns from a SQLite database requires `doctrine/dbal` dependency.
// However, we won't install it because it's too hard to specify the version of
// all the new dependencies exactly to make them support PHP ^5.5.9. Damn it.
return;
}
Schema::table('users', function (Blueprint $table) {
$table->dropColumn('remember_token');
});
});
}
}

View File

@ -1,8 +0,0 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
Schema::table('users', function (Blueprint $table) {
$table->rememberToken();
});

View File

@ -0,0 +1,7 @@
<?php
use Artisan;
option(['version' => '4.0.0']);
Artisan::call('view:clear');