]> _ Git - cubist_cms-back.git/commitdiff
#2783
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 27 May 2019 14:59:54 +0000 (16:59 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 27 May 2019 14:59:54 +0000 (16:59 +0200)
src/app/Console/Commands/MigrateCommand.php
src/app/Magic/Models/CubistMagicModelAbstract.php

index e7e0947fb0371d2e506da103f862ba3a03db53bc..ffdcb20559bfdb90447e824780a09fe521ed5b38 100644 (file)
@@ -69,6 +69,9 @@ class MigrateCommand extends CubistCommand
     public function _migrate($model)
     {
         $this->line('Handling ' . get_class($model));
-        $this->line($model->setSchema($this->_schema));
+        $res=$model->setSchema($this->_schema);
+        if(null!==$res) {
+            $this->line($res);
+        }
     }
 }
index a0c484005c0fc8c4c444849cfaf6ecf7dfcbe577..4113b874447d4c3ec7139ca913b722b75adcf23c 100644 (file)
@@ -175,9 +175,10 @@ class CubistMagicModelAbstract extends Model
         }
 
         if ($this->timestamps) {
-            $table->addColumn(static::CREATED_AT, 'date');
-            $table->addColumn(static::UPDATED_AT, 'date');
-            $table->addColumn('deleted_at', 'date');
+            $options = ['notnull' => false];
+            $table->addColumn(static::CREATED_AT, 'date', $options);
+            $table->addColumn(static::UPDATED_AT, 'date', $options);
+            $table->addColumn('deleted_at', 'date', $options);
         }
     }