This commit is contained in:
Yuri Kuznetsov
2021-06-11 11:00:57 +03:00
parent 4e08c0f3cf
commit 3c6b485321
2 changed files with 6 additions and 6 deletions
@@ -208,7 +208,7 @@ class Converter
$schema = $this->getSchema(true);
$indexList = SchemaUtils::getIndexList($ormMeta);
$indexes = SchemaUtils::getIndexes($ormMeta);
$tables = [];
@@ -278,8 +278,8 @@ class Converter
$tables[$entityName]->setPrimaryKey($primaryColumns);
if (!empty($indexList[$entityName])) {
$this->addIndexes($tables[$entityName], $indexList[$entityName]);
if (!empty($indexes[$entityName])) {
$this->addIndexes($tables[$entityName], $indexes[$entityName]);
}
}
@@ -402,7 +402,7 @@ class Converter
// add defined indexes
if (!empty($relationParams['indexes'])) {
$normalizedIndexes = SchemaUtils::getIndexList([
$normalizedIndexes = SchemaUtils::getIndexes([
$entityName => [
'fields' => [],
'indexes' => $relationParams['indexes'],
@@ -33,7 +33,7 @@ use Espo\Core\Utils\Util;
class Utils
{
public static function getIndexList(array $ormMeta, array $ignoreFlags = [])
public static function getIndexes(array $ormMeta, array $ignoreFlags = [])
{
$indexList = [];
@@ -199,7 +199,7 @@ class Utils
$fields = [];
if (!isset($indexList)) {
$indexList = static::getIndexList($ormMeta, ['fulltext']);
$indexList = static::getIndexes($ormMeta, ['fulltext']);
}
foreach ($indexList as $entityName => $indexes) {