2019-03-02 21:13:17 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
2019-12-14 11:10:37 +08:00
|
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
|
|
use Illuminate\Support\Facades\Schema;
|
2019-03-02 21:13:17 +08:00
|
|
|
|
|
|
|
class AddTidSkin extends Migration
|
|
|
|
{
|
|
|
|
public function up()
|
|
|
|
{
|
|
|
|
Schema::table('players', function (Blueprint $table) {
|
|
|
|
$table->integer('tid_skin')->default(-1);
|
2019-03-13 11:24:04 +08:00
|
|
|
|
|
|
|
if (Schema::hasColumn('players', 'preference')) {
|
|
|
|
$table->string('preference', 10)->nullable()->change();
|
|
|
|
}
|
2019-03-02 21:13:17 +08:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
public function down()
|
|
|
|
{
|
|
|
|
Schema::table('players', function (Blueprint $table) {
|
|
|
|
$table->dropColumn('tid_skin');
|
2019-03-13 11:24:04 +08:00
|
|
|
|
|
|
|
if (Schema::hasColumn('players', 'preference')) {
|
|
|
|
$table->string('preference', 10)->nullable(false)->change();
|
|
|
|
}
|
2019-03-02 21:13:17 +08:00
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|