Performing a Laravel lesson, getting "Base table or view not found: 1146 Table" sdbd_todo.migrations "does not exist"

Working through this tutorial , I went to the next step:

Now you can redirect the migration as many times as you want, and it will work:

php artisan migrate:refresh

After running this command, I get the following errors:

[Highlight \ Database \ QueryException]
  SQLSTATE [42S02]: no base table or view found: 1146 Table 'sdbd_todo.migrations' does not exist (SQL: select max ( batch) as a combination
  of migrations)

[PDOException]
SQLSTATE [42S02]: no base table or view found: 1146 Table 'sdbd_todo.migrations' does not exist

A search by mistake (obviously without a table name for the site) does not find answers that seem to help.

Full disclosure: I am new to Laravel and for that case, please calm down. :)

+1
source share
1 answer

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

php artisan migrate:refreshdesigned to reset all existing migrations and then restart. He expects the migration table already exists.

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

+2
source

All Articles