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 = 'CONSTRAINT "$name" UNIQUE';
break;
case IndexType.standardIndex:
case IndexType.none:
// not working with postgres
return;
}
// mask the column names, is more safety
columns.map((column) => '"$column"');
_stack.add('ADD $indexType (${columns.join(',')})');
}