'Logged events by the event_log module.', 'fields' => array( 'lid' => array( 'description' => 'Log id.', 'type' => 'serial', 'not null' => TRUE, ), 'type' => array( 'description' => 'Event handler type.', 'type' => 'varchar', 'length' => '50', 'not null' => TRUE, ), 'operation' => array( 'description' => 'The operation performed.', 'type' => 'varchar', 'length' => '50', 'not null' => TRUE, ), 'path' => array( 'type' => 'varchar', 'length' => '255', 'not null' => TRUE, 'default' => '', 'description' => 'Current path.', ), 'form_id' => array( 'description' => 'The form id of the submitted form.', 'type' => 'varchar', 'length' => '50', 'not null' => FALSE, ), 'ref_numeric' => array( 'description' => 'A numeric value that can be used to reference an object.', 'type' => 'int', 'not null' => FALSE, ), 'ref_char' => array( 'description' => 'A character value that can be used to reference an object.', 'type' => 'varchar', 'length' => '50', 'not null' => FALSE, ), 'description' => array( 'description' => 'Description of the event, in HTML.', 'type' => 'text', 'size' => 'medium', 'not null' => TRUE, ), 'info' => array( 'description' => 'Informative data, such as the object before modification (serialized).', 'type' => 'text', 'size' => 'medium', 'not null' => FALSE, ), 'uid' => array( 'description' => 'User id that triggered this event (0 = anonymous user).', 'type' => 'int', 'not null' => TRUE, ), 'ip' => array( 'description' => 'IP address of the visitor that triggered this event.', 'type' => 'varchar', 'length' => '255', 'not null' => FALSE, ), 'created' => array( 'description' => 'The event timestamp.', 'type' => 'int', 'not null' => TRUE, ), ), 'primary key' => array('lid'), 'indexes' => array( 'created' => array('created'), 'user' => array('uid', 'ip'), 'ip' => array('ip'), 'join' => array('type', 'operation', 'ref_numeric', 'ref_char'), ), ); return $schema; } /** * Change column types to 'varchar' to decrease storage requirements. */ function event_log_update_7300() { $spec = array('type' => 'varchar'); _event_log_update_schema_field('type', $spec); _event_log_update_schema_field('operation', $spec); _event_log_update_schema_field('form_id', $spec); _event_log_update_schema_field('ref_char', $spec); _event_log_update_schema_field('ip', $spec); } /** * Important: Change column length to support IPv6 ip adres. */ function event_log_update_7301() { _event_log_update_schema_field('ip', array('length' => '255')); } /** * Updates only the specified spec fields. * @param string $name * @param array $new_spec */ function _event_log_update_schema_field($name, $new_spec) { $schema = drupal_get_schema('event_log'); $spec = $schema['fields'][$name]; foreach ($new_spec as $key => $value) { $spec[$key] = $value; } db_change_field('event_log', $name, $name, $spec); }