Illuminate \ Database \ QueryException SQLSTATE [42S22]:找不到列:1054“字段列表”中的未知列“ current_team_id”

问题描述

设置:将db从laravel 7迁移到laravel 8,Jetstream与Teams(php artisan jetstream:安装惯性--teams),initialism.js

Illuminate\Database\Connection::runQueryCallback
vendor/laravel/framework/src/Illuminate/Database/Connection.php:671`

Illuminate\Database\QueryException
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'current_team_id' in 'field list' (SQL: update `users` set `current_team_id` = 1,`users`.`updated_at` = 2020-10-08 21:22:00 where `id` = 5)
/* @throws \Illuminate\Database\QueryException */    
protected function runQueryCallback($query,$bindings,Closure $callback)
{
    // To execute the statement,we'll simply call the callback,which will actually
    // run the SQL against the PDO connection. Then we can calculate the time it
    // took to execute and log the query SQL,bindings and time in our memory.
    try {
        $result = $callback($query,$bindings);
    }

    // If an exception occurs when attempting to run a query,we'll format the error
    // message to include the bindings with SQL,which will make this exception a
    // lot more helpful to the developer instead of just the database's errors.
    catch (Exception $e) {
        throw new QueryException(
            $query,$this->prepareBindings($bindings),$e
        );
    }

    return $result;
}

/**
 * Log a query in the connection's query log.
 *
 * @param  string  $query
 * @param  array  $bindings
 * @param  float|null  $time
 * @return void
 */

未找到一列您可能忘记了运行 迁移。您可以使用php artisan migration运行迁移。

按下下面的按钮将尝试运行您的迁移。

迁移无法解决问题。想要放入专栏吗?如何解决?

谢谢你们! :)

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)