mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-14 12:30:49 +08:00
40 lines
980 B
PHP
40 lines
980 B
PHP
<?php
|
|
|
|
namespace App\Console\Commands\Upgrade;
|
|
|
|
use Illuminate\Console\Command;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
class MigrateUsersTableCommentRelatedColumn extends Command
|
|
{
|
|
/**
|
|
* The name and signature of the console command.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $signature = 'upgrade:migrate_users_table_comment_related_column';
|
|
|
|
/**
|
|
* The console command description.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $description = 'Migrate users table comment related column';
|
|
|
|
/**
|
|
* Execute the console command.
|
|
*/
|
|
public function handle()
|
|
{
|
|
Schema::table('users', function (Blueprint $table) {
|
|
if (Schema::hasColumn('users', 'modcomment')) {
|
|
$table->dropColumn('modcomment');
|
|
}
|
|
if (Schema::hasColumn('users', 'bonuscomment')) {
|
|
$table->dropColumn('bonuscomment');
|
|
}
|
|
});
|
|
}
|
|
}
|