Class: Ronin::Database::Migrations::Migration

Inherits:
DataMapper::Migration
  • Object
show all
Defined in:
lib/ronin/database/migrations/migration.rb

Overview

Represents a Database Migration.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, options = {}, &block) ⇒ Migration

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Creates a new migration.

Parameters:

  • name (Symbol)

    The name of the migration.

  • options (Hash) (defaults to: {})

    Additional options for the migration.

Options Hash (options):

  • :verbose (Boolean) — default: false

    Enables or disables verbose output.

  • :repository (Symbol) — default: :default

    The DataMapper repository the migration will operate on.

  • :needs (Array, Symbol) — default: []

    Other migrations that are dependencies of the migration.


55
56
57
58
59
60
61
# File 'lib/ronin/database/migrations/migration.rb', line 55

def initialize(name,options={},&block)
  options[:verbose] = UI::Output.verbose?

  @needs = Array(options.delete(:needs)).uniq

  super(0,name,options,&block)
end

Instance Attribute Details

#needsObject (readonly)

The dependencies of the migration


33
34
35
# File 'lib/ronin/database/migrations/migration.rb', line 33

def needs
  @needs
end