Execute when the database does not have any tables
php artisan migrate
After execution, there will only be two tables in the database: migrations, users
Execute again
php artisan migrate
There will be no new additions to the database. Solve.
给我你的怀抱2017-05-16 16:49:03
The length of the index exceeds mysql
的限制,在migrate
before setting
$table->string('email' , 32)->index();
$table->string('token' , 128)->index();
or smaller...
大家讲道理2017-05-16 16:49:03
This is because 5.4 uses the utf8mb4 character set by default, in MySQL / MariaDB.
https://laravel.com/docs/5.4/migrations#indexes
Just install the sample modifications in the documentation.
In AppServiceProvider.php, boot method, call Schema::defaultStringLength method
// AppServiceProvider.php
use Illuminate\Support\Facades\Schema;
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
Schema::defaultStringLength(191);
}
By the way, you can also enable the database's innodb_large_prefix configuration