instance method
index_exists?
Ruby on Rails 8.1.2
Since v3.0.20Signature
index_exists?(column_name = nil, **options)
Checks to see if an index exists.
unless t.index_exists?(:branch_id) t.index(:branch_id) end
Parameters
-
column_nameopt = nil -
optionskeyrest
Source
# File activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb, line 760
def index_exists?(column_name = nil, **options)
@base.index_exists?(name, column_name, **options)
end
Defined in activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb line 760
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::ConnectionAdapters::Table