'Maps trigger to hook and operation assignments from trigger.module.', 'fields' => array( 'hook' => array( 'type' => 'varchar', 'length' => 32, 'not null' => TRUE, 'default' => '', 'description' => 'Primary Key: The name of the internal Drupal hook; for example, node_insert.', ), 'aid' => array( 'type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => '', 'description' => "Primary Key: Action's {actions}.aid.", ), 'weight' => array( 'type' => 'int', 'not null' => TRUE, 'default' => 0, 'description' => 'The weight of the trigger assignment in relation to other triggers.', ), ), 'primary key' => array('hook', 'aid'), 'foreign keys' => array( 'aid' => array('actions' => 'aid'), ), ); return $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); } $ret[] = update_sql("ALTER TABLE {trigger_assignments} DROP op"); return $ret; }