I\'ve run artisan migrate:reset
.
I\'ve deleted some of my migration files because I didn\'t need these tables anymore.
I
I had the same problem. When I was hiting php artisan migrate:reset
, I got Class 'CreateImagesTable' not found
. And composer dump-autoload
didn't help.
My solution was very easy:
php artisan make:migration create_images_table --create=images
composer dump-autoload
SQLSTATE[HY000]: General error: 1 no such table: images (SQL: drop table "images")
php artisan migrate:reset
I ran into this aswell and the solution was different to all of the above. The reason it was failing was because the filename was still mentioned in the migrations table of the DB. Because there were no unique columns I couldn't remove it with PHPMyAdmin and had to tak the CLI route.
Login to your server as root. Type the following:
mysql -p database_name
(it now prompts for your password. From here on out everything is preceded with mysql > which just means that you're in the Mysql environment.
select * from migrations;
Look for the migration file you removed and copy the name.
delete from migrations where migration = '2015_07_21_000119_create_some_table';
It should mention something about 1 row affected. Now verify that it's gone by typing the first command again:
select * from migrations;
If it's gone exit the Mysql environment by typing
exit;
Now try 'php artisan migrate:rollback' again and it should work like a charm :-)
For me, the solution was that my class name inside the migration somehow started with a lowercase letter. When I changed the class name to be all upper case, then ran a composer dump-autoload
, it ended up working for me. This is using Laravel 5.1, for what it's worth.
There is an easier way.
artisan make:migration
artisan migrate:reset
to rollback artisan migrate:refresh
The actual solution is to use the correct naming for your translations. You still may need to do a
composer dump-autoload
The migration files must be as follows
YYYY_MM_DD_000000_create_some_table.php
and the class name inside must be
class CreateSomeTable extends Migration{}
I did like this: 1. Deleted row non exist migration from migrations table from database 2. And run the command php artisan migrate:refresh
This helped to solve my problem.
*all your data will deleted from database tables