ThinkSSL🔒 一键申购 5分钟快速签发 30天无理由退款 购买更放心 广告
一个项目已经上线,然后因为后期需要添加字段可以使用这个方法 username 比如我想给 users 表添加一个 username 字段 使用命令 ~~~ php artisan make:migration add_username_to_users_table --table=users <?php use Illuminate\Support\Facades\Schema; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; class AddUsernameToUsersTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { // Schema::table('users', function (Blueprint $table) { $table->string('username'); }); } /** * Reverse the migrations. * * @return void */ public function down() { // Schema::table('users', function (Blueprint $table) { $table->dropColumn('username'); }); } } ~~~