All about Migration Rollbacks

The examples are focused on how to roll back migrations on Laravel.

php artisan migrate:rollback

This rolls back the last migrations

Migration rollback according to steps. The below code will roll back the last two migrations. Change the steps to roll back accordingly.

php artisan migrate:rollback --step=2

If you want to roll back as well as remigrate the last migrations

php artisan migrate:refresh --step=2

To roll back a specific migration

php artisan migrate:rollback --path=/database/migrations/timestamp_filename.php

I hope I have covered on migration rollbacks of Laravel.

Here is a link to how to add columns on the already existing table using migrations on laravel.

Leave a Comment

Your email address will not be published. Required fields are marked *