Search code examples
laravel-5.1database-migrationlaravel-artisanlaravel-migrations

How to migrate:rollback a specific table in laravel 5


I know this feature has been already added in laravel 5.3, but I am using Laravel 5.1, how can I do it using 5.1 version? I've also searched it on internet, but there's only solution for 5.3. Hope you can help me, and for those who have the same problem.


Solution

  • You can just edit the batch of your migration, update it as last migration. For example, if the batch of the table is 73 and you already have 74 & 75 you can just UPDATE migrations SET batch = 76 WHERE batch = 73, now your table's batch is 76, RUN php artisan migrate:rollback , and there you go.