#
# 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";
print "-- < $name\n";
}
- #print "\nCOMMIT;\n";
exit;
}
} 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);