Class: Helm::Commands::Database::Migrate

Inherits:
Command
  • Object
show all
Defined in:
lib/helm/application.rb

Instance Attribute Summary collapse

Attributes inherited from Command

#app_config, #options

Instance Method Summary collapse

Methods inherited from Command

#if_option

Constructor Details

#initialize(app_config, options) ⇒ Migrate

Returns a new instance of Migrate.



45
46
47
48
# File 'lib/helm/application.rb', line 45

def initialize(app_config, options)
  @directory = "migrations"
  super
end

Instance Attribute Details

#db_stringObject

Returns the value of attribute db_string.



49
50
51
# File 'lib/helm/application.rb', line 49

def db_string
  @db_string
end

#directoryObject

Returns the value of attribute directory.



49
50
51
# File 'lib/helm/application.rb', line 49

def directory
  @directory
end

Instance Method Details

#executeObject



51
52
53
54
55
56
57
# File 'lib/helm/application.rb', line 51

def execute
  require 'sequel/extensions/migration'

  Helm.log_at(Logger::DEBUG) do
    Sequel::Migrator.run(Helm.databases[app_config.connstring], directory)
  end
end