Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

ayub01zero's avatar

How can i delete a migration that is not found

"Hello developers, I have an issue with 4 migrations that are not found. Please let me know if there's any way to delete these migrations. I checked the migration files but couldn't find them in the migration directory. I've tried many approaches but none have worked. Could you please advise on how to delete these problematic migrations?

2025_01_13_215047_create_companies_table .................................................................. Migration not found
2025_01_11_223243_create_tag_tables ....................................................................... Migration not found
2025_01_11_223243_create_filament_blog_tables ............................................................. Migration not found
2025_01_07_235926_create_about_us_table ................................................................... Migration not found

0 likes
10 replies
ayub01zero's avatar

@OussamaMater thx but look

I have 4 migrations that Laravel says are 'not found'. However, 2 of these migrations have the same name as migrations I created before. I deleted the original migrations a long time ago, but later I created 2 new migrations using the same names as before. Now when I try to run migrations, Laravel says 'table already exists' because it's detecting the old migrations that were already run on the database. When I push to the server, I get errors. The tables exist in the database, but I only have one migration file for each name in my codebase now. I can see all the old migrations in the migrations table, but when I try to delete them, I still get the same error. How can I fix this so Laravel stops looking for the old migrations that don't exist anymore?

tykus's avatar

What operation were you attempting? Are these migration files recorded in the migrations table in your database; if so and you manually deleted the files, then simply deleting the relevant migration table records should work.

1 like
ayub01zero's avatar

@tykus I have 4 migrations that Laravel says are 'not found'. However, 2 of these migrations have the same name as migrations I created before. I deleted the original migrations a long time ago, but later I created 2 new migrations using the same names as before. Now when I try to run migrations, Laravel says 'table already exists' because it's detecting the old migrations that were already run on the database. When I push to the server, I get errors. The tables exist in the database, but I only have one migration file for each name in my codebase now. I can see all the old migrations in the migrations table, but when I try to delete them, I still get the same error. How can I fix this so Laravel stops looking for the old migrations that don't exist anymore?

tykus's avatar

@ayub01zero

I deleted the original migrations a long time ago, but later I created 2 new migrations using the same names as before

They will not have the same timestamp part of the filename (e.g 2025_01_13_215047_) in that case

ayub01zero's avatar

@tykus

Yes, it's not the same timestamp. I tried to delete by timestamp, but it didn't work. I don't know how to fix it, really. I asked ChatGPT, but it also didn't work.

ayub01zero's avatar
ayub01zero
OP
Best Answer
Level 1

@tykus

php artisan schema:dump

A long time ago, I ran this command, which seems to have determined the old migrations. After deleting the schema file in the migrations folder, everything worked. Thanks!"

martinbean's avatar

@ayub01zero Why are you deleting migration files after they’ve been applied to your database in the first place? 😬

You should never change or delete migrations after they have been ran. Otherwise your project and database ends up in an inconsistent state, like you have found.

1 like
Merklin's avatar

php artisan migrate:fresh will re-instantiate the migration table and then run the migrations.

As for your question, you can edit the migrations table in your database and delete those that you got an error. However, the above command is the preferred approach. You can also add a --seed option at the end.

Please or to participate in this conversation.