From: root Date: Fri, 6 Oct 2017 08:31:35 +0000 (+0100) Subject: dump table first, then views X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=1bcf92bc2ab8d38477664bfc3f56fbaaf262a0a4;p=nb.git dump table first, then views --- diff --git a/lib/php/db.php b/lib/php/db.php index ac74f5bf..3183e01f 100644 --- a/lib/php/db.php +++ b/lib/php/db.php @@ -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),';');