0

I have entry in migration table and file exists in the path but still getting below error

Migration not found:

I am using Lucid framework and laravel 8 version.

Anyone knows root cause?

Bhumi Shah
  • 9,323
  • 7
  • 63
  • 104
  • try drop all the `tables` in your `database` and do the `migration` again – jef Jun 03 '21 at 12:20
  • I can't do that because It is my live server – Bhumi Shah Jun 03 '21 at 12:22
  • If you can't do drop all the tables in your database, you can migrate one particular migration file. You move migration file to the your project/database/migrations folder. And can use the following commands. php artisan migrate --path=/database/migrations/migration_file_name.php – blue pine Jun 03 '21 at 13:32

1 Answers1

1

This problem occurs possibly because you performed migration, created table in database, and wanted to undo it. So you might have deleted migration file in "database/migrations/2023_02_17_061546_create_*_table".

To perform such actions, I suggest to refer the following link: Safely remove migration In Laravel

Currently, to solve your problem, lets say you are getting error like below: Migration not found: 2023_02_17_061546_create_*_table

In your database, there is a table named migrations, which has list of all the migration files it is supposed to look for the creation of the tables. Open that, and delete the row whose migration is missing. Then it shall work appropriately.

If you want to have the table in your database, then manually create an empty file with the same name, copy contents from another migration file and edit each columns of the file appropriately. In this case, dont drop the column from "migration" table in database. It will work appropriately and a new table will be developed.

Hope this will resolve the issue.

kamalesh d
  • 17
  • 1
  • 4