Return to v2.1 docs


Migrator Migration Functions void migration

Add database index on a table column Only available in a migration CFC

Name Type Required Default Description
table string Yes The table name to perform the index operation on
columnNames string No One or more column names to index, comma separated
unique boolean No false If true will create a unique index constraint
indexName string No [runtime expression] The name of the index to add: Defaults to table name + underscore + first column name
addIndex(table='members', columnNames='username', unique=true);

Related Functions

Migration Functions