Mag*_*min 4 php mysql laravel laravel-jetstream
设置:将数据库从 laravel 7 迁移到 laravel 8、Jetstream with Teams (php artisan jetstream:install惯性 --teams)、inertia.js
\nIlluminate\\Database\\Connection::runQueryCallback\nvendor/laravel/framework/src/Illuminate/Database/Connection.php:671`\n\nIlluminate\\Database\\QueryException\nSQLSTATE[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)\nRun Code Online (Sandbox Code Playgroud)\n/* @throws \\Illuminate\\Database\\QueryException */ \nprotected function runQueryCallback($query, $bindings, Closure $callback)\n{\n // To execute the statement, we\'ll simply call the callback, which will actually\n // run the SQL against the PDO connection. Then we can calculate the time it\n // took to execute and log the query SQL, bindings and time in our memory.\n try {\n $result = $callback($query, $bindings);\n }\n\n // If an exception occurs when attempting to run a query, we\'ll format the error\n // message to include the bindings with SQL, which will make this exception a\n // lot more helpful to the developer instead of just the database\'s errors.\n catch (Exception $e) {\n throw new QueryException(\n $query, $this->prepareBindings($bindings), $e\n );\n }\n\n return $result;\n}\n\n/**\n * Log a query in the connection\'s query log.\n *\n * @param string $query\n * @param array $bindings\n * @param float|null $time\n * @return void\n */\nRun Code Online (Sandbox Code Playgroud)\n\n\n未找到列您可能忘记运行\n迁移。您可以使用 php artisan migrate 运行迁移。
\n按下面的按钮将尝试运行您的迁移。
\n
迁移并没有\xc2\xb4解决问题。列应该放在哪里?怎么修?
\n
感谢你们!:)
\nSou*_*Boy 10
看来迁移错过了一个领域。通常是由于以错误的顺序运行造成的。您可以运行下面的命令来重新创建数据库,它应该可以解决问题。
php artisan migrate:fresh。
| 归档时间: |
|
| 查看次数: |
5173 次 |
| 最近记录: |