Class: Spider::Migrations::DropTable

Inherits:
IrreversibleMigration show all
Defined in:
lib/spiderfw/model/migrations/drop_table.rb

Instance Method Summary collapse

Methods inherited from IrreversibleMigration

#undo

Constructor Details

#initialize(model, options = {}) ⇒ DropTable

Returns a new instance of DropTable.



5
6
7
8
# File 'lib/spiderfw/model/migrations/drop_table.rb', line 5

def initialize(model, options={})
    @model = model
    @options = options
end

Instance Method Details

#runObject



10
11
12
13
14
15
16
# File 'lib/spiderfw/model/migrations/drop_table.rb', line 10

def run
    table = @options[:table_name]
    if !table
        table = @model.mapper.schema.table.name
    end
    @model.mapper.storage.drop_table(table)
end