]> _ Git - cubist_cms-back.git/commitdiff
wip #3707 @0:10
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 15 Jun 2020 18:35:38 +0000 (20:35 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 15 Jun 2020 18:35:38 +0000 (20:35 +0200)
src/app/Magic/Models/CubistMagicAbstractModel.php

index cee47bc7ec98e99c36a91c3e1e2319cf1cfb0495..5ead94d35027038332b33713bb4025151b4a0f1a 100644 (file)
@@ -38,6 +38,7 @@ class CubistMagicAbstractModel extends Model implements HasMedia
     protected $primaryKey = 'id';
     public $timestamps = true;
     public $clonable = true;
+    protected $_syncDbSchema = true;
 
     protected $_baseController = CubistMagicController::class;
 
@@ -324,6 +325,10 @@ class CubistMagicAbstractModel extends Model implements HasMedia
      */
     public function setSchema($schema)
     {
+        if (!$this->_syncDbSchema) {
+            return null;
+        }
+
         $table = $schema->createTable($this->table);
         try {
             $table->addColumn($this->primaryKey, self::toDoctrineType($this->keyType), ['autoincrement' => $this->incrementing, 'unsigned' => true]);