Class: DeclareSchema::SchemaChange::TableRemove

Inherits:
Base
  • Object
show all
Defined in:
lib/declare_schema/schema_change/table_remove.rb

Instance Method Summary collapse

Methods inherited from Base

#down, format_options, #up

Constructor Details

#initialize(table_name, add_table_back) ⇒ TableRemove

Returns a new instance of TableRemove.



8
9
10
11
# File 'lib/declare_schema/schema_change/table_remove.rb', line 8

def initialize(table_name, add_table_back)
  @table_name = table_name
  @add_table_back = add_table_back
end

Instance Method Details

#down_commandObject



17
18
19
# File 'lib/declare_schema/schema_change/table_remove.rb', line 17

def down_command
  @add_table_back
end

#up_commandObject



13
14
15
# File 'lib/declare_schema/schema_change/table_remove.rb', line 13

def up_command
  "drop_table #{@table_name.to_sym.inspect}"
end