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

index 500a2354d0bc189d7fddf3bb3e327d4898af7de1..b943b6eae1db99cd8650009658e721e8a66cc371 100644 (file)
@@ -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 .')'
     ;