Module: PerconaMigrations::Runners

Defined in:
lib/percona_migrations/runners.rb,
lib/percona_migrations/runners/sql.rb,
lib/percona_migrations/runners/base.rb,
lib/percona_migrations/runners/percona.rb

Defined Under Namespace

Classes: Base, Percona, Sql

Class Method Summary collapse

Class Method Details

.find_runnerObject



18
19
20
21
22
23
24
25
# File 'lib/percona_migrations/runners.rb', line 18

def self.find_runner
  if Runners::Percona.available?
    Runners::Percona
  else
    log_percona_install_command
    Runners::Sql if PerconaMigrations.allow_sql?
  end
end

.run(*args) ⇒ Object



7
8
9
10
11
12
13
14
15
16
# File 'lib/percona_migrations/runners.rb', line 7

def self.run(*args)
  runner_class = find_runner

  unless runner_class
    raise "No available migration runners found."
  end

  runner = runner_class.new(*args)
  runner.run
end