Index
Adds an index to a table.
Command
Arguments
[TABLE]
- The name of the table.*[COLUMNS]
- The columns to index.
Options/flags
--name
alias-n
The name of the index (if argument is left empty, ActiveRecord will generate a name for the index).
--options
alias-o
(Possible values: [unique, length, where, using, type])Additional options for the index.
Examples
$ eucalypt m add index games opening
Adds an index on the
opening
column in thegames
table (with default options).$ eucalypt m add index games white_elo black_elo
Adds a joint index on the
white_elo
andblack_elo
in thegames
table (with default options).$ eucalypt m add index games opening -n index_games_on_opening
Adds a named index on the
opening
column in the games table.$ eucalypt m add index games opening -o using:gist unique:false
Adds a non-unique GIST index on the
opening
column in thegames
table.
Last updated