mardi 29 août 2017

Laravel 5.5: Syntax error or access violation: 1067 Invalid default value for 'created_at'

I install laravel 5.5 and When I run php artisan migrate show me this error

[Illuminate\Database\QueryException] SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQ L: alter table users add unique users_email_unique(email))

And I add bellow code on AppServiceProvider.php

 public function boot()
{
     Schema::defaultStringLength(191); //Solved by increasing StringLength
}

And then show me this error

[Illuminate\Database\QueryException] SQLSTATE[42000]: Syntax error or access violation: 1067 Invalid default value for 'created_at' (SQL: create table password_resets (email varchar(191) not null, token varchar(191) not null, created_at timestamp not null) de fault character set utf8mb4 collate utf8mb4_unicode_ci)



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2wZIoMT
via IFTTT

Aucun commentaire:

Enregistrer un commentaire