diff options
author | Aleksander Machniak <alec@alec.pl> | 2014-09-22 09:31:11 +0200 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2014-09-22 09:31:11 +0200 |
commit | ff767a14ff7675fce7b23b918f41fa92157dd0c0 (patch) | |
tree | f7a1ed9a6c7d5ec02e967278ff6301019258ead5 /bin/updatedb.sh | |
parent | 13bbcd0f59ef7a4459a6909079f0a558913e808a (diff) | |
parent | abc00f27c5d923a02c946a634e158dfe9f20974e (diff) |
Merge branch 'oracle'
Diffstat (limited to 'bin/updatedb.sh')
-rwxr-xr-x | bin/updatedb.sh | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/bin/updatedb.sh b/bin/updatedb.sh index 964bc184c..e9818074d 100755 --- a/bin/updatedb.sh +++ b/bin/updatedb.sh @@ -55,9 +55,9 @@ if (!$DB->is_connected()) { // Read DB schema version from database (if 'system' table exists) if (in_array($DB->table_name('system'), (array)$DB->list_tables())) { - $DB->query("SELECT " . $DB->quote_identifier('value') - ." FROM " . $DB->quote_identifier($DB->table_name('system')) - ." WHERE " . $DB->quote_identifier('name') ." = ?", + $DB->query("SELECT `value`" + ." FROM " . $DB->table_name('system', true) + ." WHERE `name` = ?", $opts['package'] . '-version'); $row = $DB->fetch_array(); @@ -159,17 +159,16 @@ function update_db_schema($package, $version, $file) return; } - $system_table = $DB->quote_identifier($DB->table_name('system')); + $system_table = $DB->table_name('system', true); $DB->query("UPDATE " . $system_table - ." SET " . $DB->quote_identifier('value') . " = ?" - ." WHERE " . $DB->quote_identifier('name') . " = ?", + ." SET `value` = ?" + ." WHERE `name` = ?", $version, $package . '-version'); if (!$DB->is_error() && !$DB->affected_rows()) { $DB->query("INSERT INTO " . $system_table - ." (" . $DB->quote_identifier('name') . ", " . $DB->quote_identifier('value') . ")" - ." VALUES (?, ?)", + ." (`name`, `value`) VALUES (?, ?)", $package . '-version', $version); } |