Module: Spree::MigrationHelpers

Defined in:
lib/spree/migration_helpers.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) safe_add_index(table, column, options = {})



7
8
9
10
11
# File 'lib/spree/migration_helpers.rb', line 7

def safe_add_index(table, column, options = {})
  if columns_exist?(table, column) && !index_exists?(table, column, options)
    add_index(table, column, options)
  end
end

- (Object) safe_remove_index(table, column)



3
4
5
# File 'lib/spree/migration_helpers.rb', line 3

def safe_remove_index(table, column)
  remove_index(table, column) if index_exists?(table, column)
end