2

设置:将 db 从 laravel 7 迁移到 laravel 8,Jetstream 与 Teams(php artisan jetstream:安装惯性 --teams),惯性.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 migrate 运行您的迁移。

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

迁移并没有解决问题。把柱子放在哪里?怎么修?

感谢你们!:)

4

2 回答 2

6

看起来迁移错过了一个领域。通常是由于以错误的顺序运行。您可以运行以下命令来重新创建数据库,它应该可以解决问题。

警告

此命令将删除您的所有数据,因此仅在开发时运行。

php artisan migrate:fresh.

于 2020-10-21T15:25:22.543 回答
0

请转到 phpmyadmin 仪表板并找到用户表。

现在在用户表中添加一个名为 current_team_id 的新列。

谢谢

于 2020-10-09T07:28:53.627 回答