From b06155ece516b91ef2bcdba7cd59d3b723c4b7ff Mon Sep 17 00:00:00 2001 From: Taras Machyshyn Date: Fri, 20 Dec 2013 12:00:53 +0200 Subject: [PATCH] my commit --- .../Espo/Core/Utils/Database/Converters/Relations.php | 2 +- .../Espo/Core/Utils/Database/Converters/Schema.php | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/application/Espo/Core/Utils/Database/Converters/Relations.php b/application/Espo/Core/Utils/Database/Converters/Relations.php index 2a4eb9dfff..84f5b97300 100644 --- a/application/Espo/Core/Utils/Database/Converters/Relations.php +++ b/application/Espo/Core/Utils/Database/Converters/Relations.php @@ -128,7 +128,7 @@ class Relations $params['link']['name'].'Name' => array( 'type' => Entity::FOREIGN, 'relation' => $params['link']['name'], - 'notStorable' => true, + //'notStorable' => true, 'foreign' => $this->getForeignField('name', $foreignParams['entityName']), ), $params['link']['name'].'Id' => array( diff --git a/application/Espo/Core/Utils/Database/Converters/Schema.php b/application/Espo/Core/Utils/Database/Converters/Schema.php index 2f6579b513..a6425f9381 100644 --- a/application/Espo/Core/Utils/Database/Converters/Schema.php +++ b/application/Espo/Core/Utils/Database/Converters/Schema.php @@ -27,6 +27,10 @@ class Schema 'len' => '24', ); + protected $notStorableTypes = array( + 'foreign' + ); + public function __construct() { $this->dbalSchema = new \Doctrine\DBAL\Schema\Schema(); @@ -55,7 +59,7 @@ class Schema $uniqueColumns = array(); foreach ($entityParams['fields'] as $fieldName => $fieldParams) { - if (isset($fieldParams['notStorable']) && $fieldParams['notStorable']) { + if ((isset($fieldParams['notStorable']) && $fieldParams['notStorable']) || in_array($fieldParams['type'], $this->notStorableTypes)) { continue; } @@ -81,7 +85,7 @@ class Schema $fieldType = isset($fieldParams['dbType']) ? $fieldParams['dbType'] : $fieldParams['type']; if (!in_array($fieldType, $this->typeList)) { - $GLOBALS['log']->add('DEBUG', 'Field type ['.$fieldType.'] does not exist '.$entityName.':'.$fieldName); + $GLOBALS['log']->add('DEBUG', 'Converters/Schema::process(): Field type ['.$fieldType.'] does not exist '.$entityName.':'.$fieldName); continue; }