Login

Login
  • Register
  • VectorDesign blog

    Testing Automation and general Tech Geek stuff

    how to solve Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes during artisian migration

    Posted in laravel on 6 June 2017 by vectordesign

    Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes (SQL: alter table `users` add unique `users_email_unique`(`email`))

    edit \app\Providers\AppServiceProvider.php
    from:

    namespace App\Providers; use Illuminate\Support\ServiceProvider; class AppServiceProvider extends ServiceProvider { /** * Bootstrap any application services. * * @return void */ public function boot() { // } /** * Register any application services. * * @return void */ public function register() { // } }

    to
    namespace App\Providers;
    use Illuminate\Support\Facades\Schema;
    use Illuminate\Support\ServiceProvider;
    class AppServiceProvider extends ServiceProvider
    {
    /**
    * Bootstrap any application services.
    *
    * @return void
    */
    public function boot()
    {
    Schema::defaultStringLength(191);
    }

    /**
    * Register any application services.
    *
    * @return void
    */
    public function register()
    {
    //
    }
    }

    Leave a Reply