Sha256: 544423c20aa0bace7ec8179d2073cf0f8966ccfddb2bb844a11669ac79280a54
Contents?: true
Size: 524 Bytes
Versions: 102
Compression:
Stored size: 524 Bytes
Contents
# frozen_string_literal: true module Spree module MigrationHelpers def safe_remove_index(table, column) remove_index(table, column) if index_exists?(table, column) end def safe_add_index(table, column, options = {}) if columns_exist?(table, column) && !index_exists?(table, column, options) add_index(table, column, options) end end private def columns_exist?(table, columns) Array.wrap(columns).all? { |column| column_exists?(table, column) } end end end
Version data entries
102 entries across 102 versions & 2 rubygems