migrate rollback code example

Example 1: migration rollback

php artisan migrate:rollback

Example 2: rails rollback multiple migrations

rake db:rollback STEP=n 
# n = how many migrations you want to rollback

Example 3: laravel migration rollback

To rollback one step:

php artisan migrate:rollback

To rollback multiple steps:

php artisan migrate:rollback --step=[x]
  
To drop all tables and reload all migrations:

php artisan migrate:fresh

Example 4: laravel make migration

php artisan make:migration CreateUsersTable

Example 5: php artisan see last migration

php artisan migrate:status

Example 6: rails db:rollback

rake db:rollback VERSION=n
# n = the version you want to rollback to

Tags:

Misc Example