Answers for "sqlstate[42000]: syntax error or access violation: 1071 specified key was too long; max key length is 1000 bytes (sql: alter table `subscriptions` add index `subscriptions_user_id_stripe_status_index`(`user_id`, `stripe_status`))"

PHP
17

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

use IlluminateSupportFacadesSchema;

public function boot()
{
    Schema::defaultStringLength(191);
}
Posted by: Guest on April-29-2020

Code answers related to "sqlstate[42000]: syntax error or access violation: 1071 specified key was too long; max key length is 1000 bytes (sql: alter table `subscriptions` add index `subscriptions_user_id_stripe_status_index`(`user_id`, `stripe_status`))"

Browse Popular Code Answers by Language