Ошибка миграции при использовании поля jSON в MariaDB - PullRequest
0 голосов
/ 05 мая 2020

После попытки добавить новый столбец jSon в мою таблицу «Пользователи» я получаю сообщение об ошибке, связанной с размером поля. Я виню MariaDB, потому что они не видят будущего, но есть ли способ переопределить эту ошибку, не меняя тип поля на BLOB или TEXT?

Вот мой метод перехода:

public function up(){
  Schema::table( 'users', function( Blueprint $table ){
    $table->json( 'options' )->nullable();
  } );
}

Это ошибка, которую я получаю:

In Connection.php line 669:

  SQLSTATE[42000]: Syntax error or access violation: 1118 Row size too large. The maximum row siz
  e for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check t
  he manual. You have to change some columns to TEXT or BLOBs (SQL: alter table `users` add `opti
  ons` json null)


In PDOStatement.php line 129:

  SQLSTATE[42000]: Syntax error or access violation: 1118 Row size too large. The maximum row siz
  e for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check t
  he manual. You have to change some columns to TEXT or BLOBs


In PDOStatement.php line 127:

  SQLSTATE[42000]: Syntax error or access violation: 1118 Row size too large. The maximum row siz
  e for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check t
  he manual. You have to change some columns to TEXT or BLOBs
...