手动配置迁移命令migrate
生成的默认字符串长度,在AppServiceProvider
中调用Schema::defaultStringLength
方法来实现配置:
use Illuminate\Support\Facades\Schema;
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
Schema::defaultStringLength(191);
}