From fbaa2bb6a3916bcbf63477916a39119068ece526 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 6 Oct 2017 09:04:32 +0100 Subject: [PATCH] lib/php/db/table.php --- lib/php/db/table.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/php/db/table.php b/lib/php/db/table.php index 500a2354..b943b6ea 100644 --- a/lib/php/db/table.php +++ b/lib/php/db/table.php @@ -253,9 +253,16 @@ Class Table extends nb { ; }; + # Get all fields + $fields = []; + foreach ($this->fields() as $f) { + if (!empty($f->extras)) continue; + $fields[] = $f; + } + $sql = 'CREATE '.strtoupper($this->type()).' '.$this->sql_name() .' (' - .join(",",array_map(function($f) use ($_create) {return $_create($f);},array_values($this->fields()))) + .join(",",array_map(function($f) use ($_create) {return $_create($f);},$fields)) # done at the end for primary keys .')' ; -- 2.47.3