Merge branch 'master' of ssh://172.20.0.1/var/git/espo/backend

This commit is contained in:
Yuri Kuznetsov
2014-11-17 16:42:48 +02:00
4 changed files with 16 additions and 3 deletions
@@ -151,6 +151,10 @@ class Converter
),
);
if (isset($entityMeta['indexes'])) {
$ormMeta[$entityName]['indexes'] = $entityMeta['indexes'];
}
$ormMeta[$entityName]['fields'] = $this->convertFields($entityName, $entityMeta);
$convertedLinks = $this->convertLinks($entityName, $entityMeta, $ormMeta);
@@ -162,9 +162,15 @@ class Converter
}
$tables[$entityName]->setPrimaryKey($primaryColumns);
//add indexes
if (isset($entityParams['indexes']) && is_array($entityParams['indexes'])) {
$indexList = array_merge($indexList, $entityParams['indexes']);
}
if (!empty($indexList)) {
foreach($indexList as $indexItem) {
$tables[$entityName]->addIndex($indexItem);
foreach($indexList as $indexName => $indexItem) {
$tableIndexName = is_string($indexName) ? $indexName : null;
$tables[$entityName]->addIndex($indexItem, $tableIndexName);
}
}
@@ -198,7 +198,7 @@ class Schema
$result = true;
$connection = $this->getConnection();
foreach ($queries as $sql) {
$GLOBALS['log']->debug('SCHEMA, Execute Query: '.$sql);
$GLOBALS['log']->info('SCHEMA, Execute Query: '.$sql);
try {
$result &= (bool) $connection->executeQuery($sql);
} catch (\Exception $e) {
@@ -162,5 +162,8 @@
"collection": {
"sortBy": "name",
"asc": true
},
"indexes": {
"name": ["name"]
}
}