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