简体   繁体   中英

when doing “php artisan migrate” i got: Base table or view already exists: 1050 Table 'users'. (I am using PHPSTORM 2018.3.4)

I drop the DB and then create it again. This is after i drop; (Migration & user migrated successfully)

Migration table created successfully.

In Connection.php line 664:

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 ))

In Connection.php line 458:

SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes

public function boot()
{
    Schema::defaultStringLength(191);
    //
}

in provider folder find Appserviceprovider.php your boot function should be look like this and don't forget to add use Schema; at the top

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM