Module: DynamoDB::Migration

Defined in:
lib/dynamodb/migration.rb,
lib/dynamodb/migration/unit.rb,
lib/dynamodb/migration/execute.rb,
lib/dynamodb/migration/version.rb

Defined Under Namespace

Classes: Execute, Unit

Constant Summary collapse

VERSION =
"0.6.0"

Class Method Summary collapse

Class Method Details

.registered(app) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/dynamodb/migration.rb', line 8

def registered(app)
  options = {
    client:                 app.dynamodb_client,
    path:                   app.settings.migrations_path,
    migration_table_name:   app.settings.migration_table_name,
  }
  run_all_migrations(options)
end

.run_all_migrations(options) ⇒ Object



17
18
19
20
21
22
23
# File 'lib/dynamodb/migration.rb', line 17

def run_all_migrations(options)
  Dir.glob("#{options[:path]}/**/*.rb").each do |file|
    require file
  end
  Execute.new(options[:client], options[:migration_table_name])
         .update_all
end