diff options
author | Dries Buytaert <dries@buytaert.net> | 2009-09-29 15:13:57 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2009-09-29 15:13:57 +0000 |
commit | cef10893892a1c40f73fd972969c3512b0983cd6 (patch) | |
tree | c295a5dea1cc8f5d0ced7e7c967c70cf34f33c73 /modules/trigger | |
parent | 0a0b067c2404b041454cc7a5fc8cfbbb9ecd6027 (diff) | |
download | brdo-cef10893892a1c40f73fd972969c3512b0983cd6.tar.gz brdo-cef10893892a1c40f73fd972969c3512b0983cd6.tar.bz2 |
- Patch #570900 by Crell | asimmonds: Changed Destroy remnants of update_sql().
Diffstat (limited to 'modules/trigger')
-rw-r--r-- | modules/trigger/trigger.install | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/modules/trigger/trigger.install b/modules/trigger/trigger.install index b8553e48c..95fb4fb2e 100644 --- a/modules/trigger/trigger.install +++ b/modules/trigger/trigger.install @@ -54,13 +54,15 @@ function trigger_schema() { * Adds operation names to the hook names and drops the "op" field. */ function trigger_update_7000() { - $ret = array(); $result = db_query("SELECT hook, op, aid FROM {trigger_assignments} WHERE op <> ''"); - while ($row = db_fetch_object($result)) { - $ret[] = update_sql("UPDATE {trigger_assignments} SET hook = '%s' WHERE hook = '%s' AND op = '%s' AND aid = '%s'", $row->hook . '_' . $row->op, $row->hook, $row->op, $row->aid); + foreach ($result as $record) { + db_update('trigger_assignments') + ->fields(array('hook' => $record->hook . '_' . $record->op)) + ->condition('hook', $record->hook) + ->condition('op', $record->op) + ->condition('aid', $record->aid) + ->execute(); } - $ret[] = update_sql("ALTER TABLE {trigger_assignments} DROP op"); - - return $ret; + db_drop_field('trigger_assignments', 'op'); } |