blessing-skin-server/database/migrations/2019_03_01_131420_add_tid_skin.php

31 lines
802 B
PHP
Raw Normal View History

<?php
use Illuminate\Database\Migrations\Migration;
2019-12-14 11:10:37 +08:00
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
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();
}
});
}
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();
}
});
}
}