Framework: Migration not found on migrate:refresh with --path option

Created on 3 Apr 2018  ยท  6Comments  ยท  Source: laravel/framework

I am getting "Migration not found" when running migrate:refresh with --path option.

Seems that the script tries to rollback all migrations, not only specified ones.

php artisan migrate:refresh --path=packages/package/src/database/migrations

Migration not found: 2016_06_01_000005_create_oauth_personal_access_clients_table
Migration not found: 2016_06_01_000004_create_oauth_clients_table
Migration not found: 2016_06_01_000003_create_oauth_refresh_tokens_table
Migration not found: 2016_06_01_000002_create_oauth_access_tokens_table
Migration not found: 2016_06_01_000001_create_oauth_auth_codes_table
Migration not found: 2014_10_12_100000_create_password_resets_table
Migration not found: 2014_10_12_000000_create_users_table

The final result is actually fine. It refreshes the specified folder migrations.

Most helpful comment

Hello everyone !

The post is a year old, but I found a solution with your help.
To remove this error, go to your DB and drop the column.
after you have to make a

php artisan migrete

Capture

All 6 comments

i'm getting this same error, when trying to drop a column

If you run a migration from a path and then; run php artisan migrate:rollback or something which calls Migrator::rollbackMigrations method like migrate:refresh; the same error will be noted.

e.g.:

โฏ art migrate --path=database/migrations/foo
Migrating: 2018_10_23_104449_foo
Migrated:  2018_10_23_104449_foo
โฏ art migrate:rollback
Migration not found: 2018_10_23_104449_foo

Storing the path of the migration files can change this behavior. But is this what Laravel should do?

@dorin-niscu you need to use

php artisan migrate:refresh --path=vendor/laravel/passport/database/migrations

@erdemkeren you didn't specify the path with the rollback command.

@driesvints Indeed. I was talking about persisting the path of the migration files to migrations table inside another column (maybe).

@erdemkeren that's not something we're going to change. If the location of the migrations would change you'd have to update the values in the database as well.

Hello everyone !

The post is a year old, but I found a solution with your help.
To remove this error, go to your DB and drop the column.
after you have to make a

php artisan migrete

Capture

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lzp819739483 picture lzp819739483  ยท  3Comments

Anahkiasen picture Anahkiasen  ยท  3Comments

ghost picture ghost  ยท  3Comments

RomainSauvaire picture RomainSauvaire  ยท  3Comments

kerbylav picture kerbylav  ยท  3Comments