From 1bcf92bc2ab8d38477664bfc3f56fbaaf262a0a4 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 6 Oct 2017 09:31:35 +0100 Subject: [PATCH] dump table first, then views --- lib/php/db.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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),';'); -- 2.47.3