进行Laravel教程,获取“找不到基表或视图:1146表'sdbd_todo.migrations'不存在".

进行Laravel教程,获取“找不到基表或视图:1146表'sdbd_todo.migrations'不存在

问题描述:

通过本教程,我需要执行以下步骤:

Working through this tutorial, I'm down to the following step:

您现在应该可以根据需要多次调用迁移了,并且可以正常运行:

You should now be able to call migrate as many times as you want and it’ll work:

php artisan migrate:refresh

运行该命令时,出现以下错误:

Upon running that command, I get the following errors:

[Illuminate \ Database \ QueryException]
SQLSTATE [42S02]:找不到基表或视图:1146表'sdbd_todo.migrations'不存在(SQL:选择max(batch)作为聚合
来自migrations)

[Illuminate\Database\QueryException]
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'sdbd_todo.migrations' doesn't exist (SQL: select max(batch) as aggregate
from migrations)

[PDOException]
SQLSTATE [42S02]:找不到基表或视图:1146表'sdbd_todo.migrations'不存在

[PDOException]
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'sdbd_todo.migrations' doesn't exist

谷歌搜索错误(显然没有站点特定的表名)找不到任何有帮助的答案.

Googling about the error (obviously without the site-specific table name) doesn't find any answers that seem to help.

完全公开:我是Laravel的新手,因此对于Stack Overflow,请放轻松. :)

Full disclosure: I'm new to Laravel, and to Stack Overflow for that matter, please go easy on me. :)

php artisan migrate将为您创建迁移表(如果尚不存在),然后运行所有尚未运行的迁移.

php artisan migrate will create the migrations table for you if it does not exist yet, then run any and all migrations that have not been run yet.

php artisan migrate:refresh用于重置所有现有迁移,然后再次运行它们.它希望迁移表已经存在.

php artisan migrate:refresh is for resetting all existing migrations, then running them again. It expects the migrations table to already exist.

您可以使用php artisan list列出所有可用的Artisan命令及其说明,以了解有关这些命令以及其他与迁移相关的命令的更多信息.

You can use php artisan list to list all available Artisan commands and their descriptions to learn more about these and other migration-related commands.