From d48b5dc8c67eaabb381a455d0b6b4d9a5cdcf921 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Wed, 29 May 2019 19:47:56 +0200 Subject: [PATCH] #2783 --- src/app/Magic/Fields/Field.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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]); } -- 2.39.5