Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration not found on migrate:refresh with --path option #23789

Closed
dorinniscu opened this issue Apr 3, 2018 · 7 comments
Closed

Migration not found on migrate:refresh with --path option #23789

dorinniscu opened this issue Apr 3, 2018 · 7 comments

Comments

@dorinniscu
Copy link

dorinniscu commented Apr 3, 2018

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.

@Louis95
Copy link

Louis95 commented Jul 30, 2018

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

@erdemkeren
Copy link

erdemkeren commented Oct 23, 2018

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?

@driesvints
Copy link
Member

@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.

@erdemkeren
Copy link

erdemkeren commented Nov 20, 2018

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

@driesvints
Copy link
Member

@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.

@AndresGomesIglesias
Copy link

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

@mohsenmojadam2019
Copy link

You must delete the content of the migration table in the database

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants