method

enable_index

rails latest stable - Class: ActiveRecord::ConnectionAdapters::MySQL::Table

Method not available on this version

This method is only available on newer versions. The first available version (v8.1.1) is shown here.

enable_index(index_name)
public

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}[rdoc-ref:SchemaStatements#enable_index]