]> _ Git - cubist_cms-back.git/commitdiff
#2783
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 29 May 2019 17:47:56 +0000 (19:47 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 29 May 2019 17:47:56 +0000 (19:47 +0200)
src/app/Magic/Fields/Field.php

index 7e8063b23cf1898dcf3c7c6bef87a74868ff6e1f..0193bf3b049a2a72b7d075c65e3b3e5f37c6bc56 100644 (file)
@@ -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]);
         }