Jan 25, 2017
23
Level 1
Laravel 5.4 failing on php artisan migrate after php artisan make:auth
Hi, I decided to test the new Laravel 5.4. So I started with the basic commands:
$ laravel new blog
$ php artisan make:auth
$ php artisan migrate
The last command returns an error, I will write it here:
[Illuminate\Database\QueryException]
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key
length is 767 bytes (SQL: alter table `users` add unique `users_email_unique`(`email`))
[PDOException]
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key
length is 767 bytes
The database configuration on .env file is correct, since booth migrations and users table are created.
Any idea why is this failing?
Level 2
to fix this, all you have to do is to edit your AppServiceProvider.php file and add to the boot method a default string length
use Illuminate\Support\Facades\Schema;
function boot()
{
Schema::defaultStringLength(191);
}
54 likes
Please or to participate in this conversation.