]> git.nbdom.net Git - nb.git/commitdiff
dump table first, then views
authorroot <sys@15gifts.com>
Fri, 6 Oct 2017 08:31:35 +0000 (09:31 +0100)
committerroot <sys@15gifts.com>
Fri, 6 Oct 2017 08:31:35 +0000 (09:31 +0100)
lib/php/db.php

index ac74f5bfc0c47f11693874a77c0227116cc2b18d..3183e01fcc5946d9c2727c594b6aeb75d78ac2f5 100644 (file)
@@ -969,7 +969,10 @@ class Db extends nb {
         continue;
       }
 
-      if ($t->type == 'view') $views[] = $t->name;
+      if ($t->type == 'view') {
+        $views[$k] = $t;
+        unset($tables[$k]);
+      }
       unset($t->orderby);
 
       $t->fields();
@@ -1011,7 +1014,7 @@ class Db extends nb {
     }
 
       #bye($this->db()->type);
-    foreach ($tables as $t) {
+    foreach (array_merge($tables,$views) as $t) {
 
       # DROP / CREATE
       $create = rtrim($t->create(false),';');