From fbc8444b047cef18bdd95f3c57bca528ba7bba30 Mon Sep 17 00:00:00 2001 From: Devops Date: Thu, 6 Apr 2017 17:27:28 +0100 Subject: [PATCH] www/dbq/dbq.php --- bin/ovh-api | 10 +++------- www/dbq/dbq.php | 2 +- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/bin/ovh-api b/bin/ovh-api index 9632e918..aa177970 100755 --- a/bin/ovh-api +++ b/bin/ovh-api @@ -259,18 +259,15 @@ my @tbs = ( # # Tables # - #print "-- sqlite3: PRAGMA foreign_keys=OFF;\n"; - #print "BEGIN TRANSACTION;\n"; for my $tb (@tbs) { - #warn $tb->{name}; my $name =$preff.$tb->{name}; print "\n-- > $name\n"; - print "CREATE TABLE IF NOT EXISTS $name (\n" - .join(",\n",map {" $_->{sql}"} @{$tb->{fields}}) - ."\n);\n"; + print "CREATE TABLE IF NOT EXISTS $name (" + .join(",",map {"$_->{sql}"} @{$tb->{fields}}) + .");\n"; for my $iname (keys %{$tb->{indexes}}) { print 'CREATE INDEX IF NOT EXISTS '.$preff.$iname.' ON '.$preff.'server('.$tb->{indexes}{$iname}.");\n"; @@ -325,7 +322,6 @@ my @tbs = ( print "-- < $name\n"; } - #print "\nCOMMIT;\n"; exit; } diff --git a/www/dbq/dbq.php b/www/dbq/dbq.php index 1179d0bd..9d52a416 100644 --- a/www/dbq/dbq.php +++ b/www/dbq/dbq.php @@ -859,7 +859,7 @@ EOF; } elseif ($action == 'update' and $this->perm >= self::WRITE) { # NB 19.12.16: TODO NOT WORKING with update using replace - if (!$this->table->replace($_POST,$info)) $this->error('update: '.print_r($info,true)); + if (!$this->table->update($_POST,$info)) $this->error('update: '.print_r($info,true)); header('Location: '.$this->table->base.'/'); $this->page($info); -- 2.47.3