Rollback command is used to rollback the last migration means remove the last migration from the database. Laravel provides different commands to rollback tables from the database, these are:-
1. php artisan migrate:rollback :- It rollback the last migration we have migrated. See below:-
2. php artisan migrate:rollback –step=(No.-of-migrations) :- It rollback the limited number of last migrations (no. is provided after step) from the database. See below:-
In the above example, Step=3 means it rollback last 3 migrations. So after the execution of command as you see that last 3 migrations are rollbacked.
3. php artisan migrate:reset :- It will rollback all the migrations from the database with only one command.
4. php artisan migrate:refresh :- After calling refresh, it first rollback all the migrations and then execute migrate command automatically. This command effectively re-creates your entire database. See below:-
- What is On-Page Optimization and Off-page Optimization - March 14, 2024
- [SOLVED] Flutter : PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException: 10: , null, null) - December 7, 2021
- [Solved] Flutter : Error: The getter ‘subhead’ isn’t defined for the class ‘TextTheme’ from package:flutter/src/material/text_theme.dart’ – searchable_dropdown - December 6, 2021