Method: DBGeni::MigrationCLI#apply_until_migration

Defined in:
lib/dbgeni/migration_cli.rb

#apply_until_migration(migration_name, force = nil) ⇒ Object



60
61
62
63
64
65
66
67
68
69
70
# File 'lib/dbgeni/migration_cli.rb', line 60

def apply_until_migration(migration_name, force=nil)
  ensure_initialized
  milestone = find_migration(migration_name)
  outstanding = outstanding_migrations
  index = outstanding.index milestone
  unless index
    # milestone migration doesn't exist or is already applied.
    raise MigrationNotOutstanding, milestone.to_s
  end
  apply_migration_list(outstanding[0..index], force)
end