blessing-skin-server/database/migrations/2019_03_01_131420_add_tid_skin.php
2019-03-13 11:24:04 +08:00

41 lines
946 B
PHP

<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddTidSkin extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('players', function (Blueprint $table) {
$table->integer('tid_skin')->default(-1);
if (Schema::hasColumn('players', 'preference')) {
$table->string('preference', 10)->nullable()->change();
}
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('players', function (Blueprint $table) {
$table->dropColumn('tid_skin');
if (Schema::hasColumn('players', 'preference')) {
$table->string('preference', 10)->nullable(false)->change();
}
});
}
}