瀏覽代碼

Update 'src/Schema/Db/Table.php'

ahwelp 6 年之前
父節點
當前提交
ad50a598af
共有 1 個文件被更改,包括 5 次插入3 次删除
  1. 5 3
      src/Schema/Db/Table.php

+ 5 - 3
src/Schema/Db/Table.php

@@ -626,9 +626,11 @@ class Table
      */
     public function create()
     {
-        $this->getAdapter()->createTable($this);
-        $this->saveData();
-        $this->reset(); // reset pending changes
+      	if (!$this->getAdapter()->hasTable($this->name)) {
+        	$this->getAdapter()->createTable($this);
+        	$this->saveData();
+        	$this->reset(); // reset pending changes
+        }
     }
 
     /**