public function convertIndexDescription(Table $table, $row)
{
$type = Table::INDEX_INDEX;
$name = $row['relname'];
if ($row['indisprimary']) {
$name = $type = Table::CONSTRAINT_PRIMARY;
}
if ($row['indisunique'] && $type === Table::INDEX_INDEX) {
$type = Table::CONSTRAINT_UNIQUE;
}
if ($type === Table::CONSTRAINT_PRIMARY || $type === Table::CONSTRAINT_UNIQUE) {
$this->_convertConstraint($table, $name, $type, $row);
return;
}
$index = $table->index($name);
if (!$index) {
$index = ['type' => $type, 'columns' => []];
}
$index['columns'][] = $row['attname'];
$table->addIndex($name, $index);
}