addIndex method
Implementation
@override
void addIndex(String name, List<String> columns, IndexType type) {
String indexType = '';
switch (type) {
case IndexType.primaryKey:
indexType = 'PRIMARY KEY';
break;
case IndexType.unique:
indexType = 'UNIQUE INDEX `$name`';
break;
case IndexType.standardIndex:
case IndexType.none:
indexType = 'INDEX `$name`';
break;
}
// mask the column names, is more safety
columns.map((column) => '`$column`');
_stack.add('ADD $indexType (${columns.join(',')})');
}