Method: DBGeni::MigrationCLI#rollback_last_migration

Defined in:
lib/dbgeni/migration_cli.rb

#rollback_last_migration(force = nil) ⇒ Object



106
107
108
109
110
111
112
113
114
# File 'lib/dbgeni/migration_cli.rb', line 106

def rollback_last_migration(force=nil)
  ensure_initialized
  migrations = applied_and_broken_migrations
  if migrations.length == 0
    raise DBGeni::NoAppliedMigrations
  end
  # the most recent one is at the end of the array!!
  apply_migration_list([migrations.last], force, false)
end