Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rollback single table

How to rollback the single table in laravel 4. I ran php artisan migrate:rollback to roll back all the migrations but how to rollback the single table

Advice much appreciated

like image 444
Rajat Avatar asked Jan 26 '26 06:01

Rajat


1 Answers

for example, you want to create the user table again, just go to mysql and delete from migration's table the field that correspond to TIMESTAMP_create_users_table:

DELETE FROM MIGRATIONS WHERE MIGRATION ="2014_10_12_000000_create_users_table";

and drop the users table too:

DROP TABLE users;

after that, just run

php artisan migrate

and that's it!

like image 194
Andres Felipe Avatar answered Jan 27 '26 21:01

Andres Felipe