diff --git a/application/Espo/Core/Utils/Database/DBAL/Schema/Column.php b/application/Espo/Core/Utils/Database/DBAL/Schema/Column.php index af463ec011..ceb0e9aa97 100644 --- a/application/Espo/Core/Utils/Database/DBAL/Schema/Column.php +++ b/application/Espo/Core/Utils/Database/DBAL/Schema/Column.php @@ -31,4 +31,52 @@ class Column extends \Doctrine\DBAL\Schema\Column */ protected $_notnull = false; + /** + * @var boolean + */ + protected $_unique = false; + + + /** + * @param boolean $unique + * + * @return \Doctrine\DBAL\Schema\Column + */ + public function setUnique($unique) + { + $this->_unique = (bool)$unique; + + return $this; + } + + /** + * @return boolean + */ + public function getUnique() + { + return $this->_unique; + } + + /** + * @return array + */ + public function toArray() + { + return array_merge(array( + 'name' => $this->_name, + 'type' => $this->_type, + 'default' => $this->_default, + 'notnull' => $this->_notnull, + 'length' => $this->_length, + 'precision' => $this->_precision, + 'scale' => $this->_scale, + 'fixed' => $this->_fixed, + 'unsigned' => $this->_unsigned, + 'autoincrement' => $this->_autoincrement, + 'unique' => $this->_unique, + 'columnDefinition' => $this->_columnDefinition, + 'comment' => $this->_comment, + ), $this->_platformOptions, $this->_customSchemaOptions); + } + } \ No newline at end of file diff --git a/application/Espo/Resources/metadata/fields/email.json b/application/Espo/Resources/metadata/fields/email.json index ef96abe8e2..0defab3acf 100644 --- a/application/Espo/Resources/metadata/fields/email.json +++ b/application/Espo/Resources/metadata/fields/email.json @@ -10,6 +10,7 @@ "type":"int" } ], + "notCreatable": true, "search":{ "basic":true, "advanced":true