Module: ActiveRecord::ConnectionAdapters::SchemaStatements

Defined in:
lib/webget_ramp/active_record/connection_adapters/abstract/schema_statements.rb

Instance Method Summary collapse

Instance Method Details

#add_column_and_index(table_name, column_name, type, options = {}) ⇒ Object

Add a column and its index. This just calls #add_column then #add_index



8
9
10
11
# File 'lib/webget_ramp/active_record/connection_adapters/abstract/schema_statements.rb', line 8

def add_column_and_index(table_name, column_name, type, options = {})
  add_column(table_name, column_name, type, options)
  add_index(table_name, column_name, type, options)
end

#remove_column_and_index(table_name, column_name, type, options = {}) ⇒ Object

Remove a column and its index in one step. This just calls #remove_column then #remove_index.



17
18
19
20
# File 'lib/webget_ramp/active_record/connection_adapters/abstract/schema_statements.rb', line 17

def remove_column_and_index(table_name, column_name, type, options = {})
  remove_column(table_name, column_name, type, options)
  remove_index(table_name, column_name, type, options)
end