php artisan make:migration alter_sources_description --table=life_car_sources
php artisan migrate
php artisan migrate:rollback --step=1 # 回滚变更
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

/**
* php artisan make:migration alter_sources_description --table=要改的表名称
* php artisan migrate
* php artisan migrate:rollback --step=1 # 回滚变更
*/
class AlterSourcesDescription extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('要改的表名称', function (Blueprint $table) {
DB::statement("ALTER TABLE 要改的表名称 MODIFY vehicle_description varchar(1000) default '' NOT NULL COMMENT '车辆描述';");
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('要改的表名称', function (Blueprint $table) {
DB::statement("ALTER TABLE 要改的表名称 MODIFY vehicle_description varchar(255) default '' NOT NULL COMMENT '车辆描述';");
});
}
}

​Database: Migrations​

新增字段

php artisan make:migration add_字段名_to_表名 --table=表名 

<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class AddPayMethodToOrder extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('表名', function (Blueprint $table) {
$table->tinyInteger("字段名")->default(2)->comment("1-xxx 2-yyyy")->after("前面一个字段名");
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('表名', function (Blueprint $table) {
$table->removeColumn("字段名");
});
}
}