Rollback Migrations
Rollback Last Migration
migrator = MyDB.migrator(config)
migrator.down
puts "Rolled back one migration"Rollback Multiple Migrations
# Rollback last 3 migrations
3.times { migrator.down }Rollback to Specific Version
# Rollback to version 5
migrator.down_to(5)Rollback All Migrations
# Rollback everything (use with caution!)
migrator.down_to(0)Check Before Rollback
Safe Rollback Script
Handle Irreversible Migrations
Refresh Database
Verify Rollback
Related
Last updated
Was this helpful?