Lumen 5.6 Migrate Error Specified key was too long max key length is 767 bytes

前端 未结 6 1389
生来不讨喜
生来不讨喜 2021-02-14 16:45

I use Lumen 5.6 and mysql. when i type \"php artisan migrate\" following error occur:

SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was t         


        
6条回答
  •  无人及你
    2021-02-14 17:46

    use Illuminate\Support\Facades\Schema; //AppServiceProvider.php
    
    public function boot(){
    Schema::defaultStringLength(191);
    }
    
    //rollback your migration or delete all table from database then migrate again.
    

提交回复
热议问题