Class: ActiveRecord::ConnectionAdapters::MySQL::Table

Inherits:
Table
  • Object
show all
Includes:
ColumnMethods
Defined in:
lib/active_record/connection_adapters/mysql/schema_definitions.rb

Overview

Active Record MySQL Adapter Table

Instance Attribute Summary

Attributes inherited from Table

#name

Instance Method Summary collapse

Methods included from ColumnMethods

#blob

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

#primary_key

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.

See connection.disable_index



137
138
139
# File 'lib/active_record/connection_adapters/mysql/schema_definitions.rb', line 137

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.

See connection.enable_index



126
127
128
# File 'lib/active_record/connection_adapters/mysql/schema_definitions.rb', line 126

def enable_index(index_name)
  @base.enable_index(name, index_name)
end