Class: ActiveRecord::ConnectionAdapters::MySQL::Table
- Includes:
- ColumnMethods
- Defined in:
- activerecord/lib/active_record/connection_adapters/mysql/schema_definitions.rb
Overview
Active Record MySQL Adapter Table
Instance Attribute Summary
Attributes inherited from Table
Instance Method Summary collapse
-
#disable_index(index_name) ⇒ Object
Disables an index not to be used by query optimizers.
-
#enable_index(index_name) ⇒ Object
Enables an index to be used by query optimizers.
Methods included from ColumnMethods
Methods included from ActiveSupport::Concern
#append_features, #class_methods, extended, #included, #prepend_features, #prepended
Methods inherited from Table
#change, #change_default, #change_null, #check_constraint, #check_constraint_exists?, #column, #column_exists?, #foreign_key, #foreign_key_exists?, #index, #index_exists?, #initialize, #references, #remove, #remove_check_constraint, #remove_foreign_key, #remove_index, #remove_references, #remove_timestamps, #rename, #rename_index, #timestamps
Methods included from ColumnMethods
Constructor Details
This class inherits a constructor from ActiveRecord::ConnectionAdapters::Table
Instance Method Details
#disable_index(index_name) ⇒ Object
Disables an index not to be used by query optimizers.
t.disable_index(:email)
Note: only supported by MySQL version 8.0.0 and greater, and MariaDB version 10.6.0 and greater.
140 141 142 |
# File 'activerecord/lib/active_record/connection_adapters/mysql/schema_definitions.rb', line 140 def disable_index(index_name) @base.disable_index(name, index_name) end |
#enable_index(index_name) ⇒ Object
Enables an index to be used by query optimizers.
t.enable_index(:email)
Note: only supported by MySQL version 8.0.0 and greater, and MariaDB version 10.6.0 and greater.
129 130 131 |
# File 'activerecord/lib/active_record/connection_adapters/mysql/schema_definitions.rb', line 129 def enable_index(index_name) @base.enable_index(name, index_name) end |