Index
Adds an index to a table.
Command
$ eucalypt migration add index
# Alias/shortened
$ eucalypt m add index
$ eucalypt m add i
$ eucalypt m a iArguments
[TABLE]- The name of the table.*[COLUMNS]- The columns to index.
Options/flags
--namealias-nThe name of the index (if argument is left empty, ActiveRecord will generate a name for the index).
--optionsalias-o(Possible values: [unique, length, where, using, type])Additional options for the index.
Examples
$ eucalypt m add index games openingAdds an index on the
openingcolumn in thegamestable (with default options).$ eucalypt m add index games white_elo black_eloAdds a joint index on the
white_eloandblack_eloin thegamestable (with default options).$ eucalypt m add index games opening -n index_games_on_openingAdds a named index on the
openingcolumn in the games table.$ eucalypt m add index games opening -o using:gist unique:falseAdds a non-unique GIST index on the
openingcolumn in thegamestable.
Last updated