From: Vincent Vanwaelscappel Date: Wed, 29 May 2019 17:47:56 +0000 (+0200) Subject: #2783 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=d48b5dc8c67eaabb381a455d0b6b4d9a5cdcf921;p=cubist_cms-back.git #2783 --- diff --git a/src/app/Magic/Fields/Field.php b/src/app/Magic/Fields/Field.php index 7e8063b..0193bf3 100644 --- a/src/app/Magic/Fields/Field.php +++ b/src/app/Magic/Fields/Field.php @@ -39,6 +39,14 @@ class Field return new $class($attributes); } + public function getDatabaseType() + { + if ($this->_translatable) { + return 'text'; + } + return $this->_databaseType; + } + protected static function _getClass($type) { $type = Str::studly($type); @@ -108,7 +116,7 @@ class Field public function defineDbColumn($table) { $name = $this->getAttribute('name'); - $table->addColumn($name, CubistMagicAbstractModel::toDoctrineType($this->_databaseType), $this->_databaseAttributes); + $table->addColumn($name, CubistMagicAbstractModel::toDoctrineType($this->getDatabaseType()), $this->_databaseAttributes); if ($this->_databaseUnique) { $table->addUniqueIndex([$name]); }