@igordata1

Как от этой ошибки избавиться?

php artisan migrate:refresh
Rolling back: 2020_05_28_081938_create_createusers_table

Illuminate\Database\QueryException : SQLSTATE[42000]: Syntax error or access violation: 1091 Can't DROP 'age'; check that column/key exists (SQL: alter table `users` drop `age`)

at /var/www/bossphp.x/vendor/laravel/framework/src/Illuminate/Database/Connection.php:664
660| // If an exception occurs when attempting to run a query, we'll format the error
661| // message to include the bindings with SQL, which will make this exception a
662| // lot more helpful to the developer instead of just the database's errors.
663| catch (Exception $e) {
> 664| throw new QueryException(
665| $query, $this->prepareBindings($bindings), $e
666| );
667| }
668|

Exception trace:

1 PDOException::("SQLSTATE[42000]: Syntax error or access violation: 1091 Can't DROP 'age'; check that column/key exists")
/var/www/bossphp.x/vendor/laravel/framework/src/Illuminate/Database/Connection.php:458

2 PDOStatement::execute()
/var/www/bossphp.x/vendor/laravel/framework/src/Illuminate/Database/Connection.php:458

Please use the argument -v to see more details.
  • Вопрос задан
  • 2781 просмотр
Решения вопроса 1
alexey-m-ukolov
@alexey-m-ukolov Куратор тега Laravel
Очень легко:
check that column/key exists


Вы в down пытаетесь удалить колонку, которой не существует. Можно написать dropIfExists или вообще удалить.
Ответ написан
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы