Support more index types in DB table parser

UNIQUE, SPATIAL, FULLTEXT
This commit is contained in:
Kijin Sung 2020-07-11 15:42:37 +09:00
parent 5f8ceafdf6
commit 9b776942e5
5 changed files with 25 additions and 8 deletions

View file

@ -9,5 +9,5 @@ class Index
{
public $name;
public $columns = array();
public $is_unique = false;
public $type = null;
}

View file

@ -90,7 +90,7 @@ class Table
}
$idxcolumns[] = '`' . $column_name . '`' . ($prefix_size > 0 ? "($prefix_size)" : '');
}
$idxtype = ($index->is_unique ? 'UNIQUE' : 'INDEX');
$idxtype = $index->type ? ($index->type . ' INDEX') : 'INDEX';
$idxdef = ' ' . $idxtype . ' `' . $index->name . '` (' . implode(', ', $idxcolumns) . ')';
$columns[] = $idxdef;
}