Detail Error : SQLSTATE[42000]: 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`))
How to Fix
it:
- Go to the root folder \APP\Providers\AppServiceProvider.php
- Add Script
use Illuminate\Support\Facades\Schema;
and Schema::defaultStringLength(191); - Save and don’t forget to remove table data on database
- Another mistake like this will show if you forget to delete a database table.
“SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'users' already exists (SQL: create table `users` (`id` int unsigned not null auto_increment primary key, `name` varchar(191) not null, `email` varchar(191) not null, `email_verified_at` timestamp null, `password` varchar(191) not null, `photo` varchar(191) null, `gender` varchar(191) not null, `active` int not null, `deleted_at` timestamp null, `remember_token` varchar(100) null, `created_at` timestamp null, `updated_at` timestamp null) default character set utf8mb4 collate 'utf8mb4_unicode_ci')”
- And you can run again to migrate data “php artisan migrate –seed”
Tidak ada komentar:
Posting Komentar