You are here

function feeds_update_7203 in Feeds 8.2

Same name and namespace in other branches
  1. 7.2 feeds.install \feeds_update_7203()

Add feeds_log table.

File

./feeds.install, line 469
Schema definitions install/update/uninstall hooks.

Code

function feeds_update_7203() {
  $schema = array(
    'description' => 'Table that contains logs of feeds events.',
    'fields' => array(
      'flid' => array(
        'type' => 'serial',
        'not null' => TRUE,
        'description' => 'Primary Key: Unique feeds event ID.',
      ),
      'id' => array(
        'type' => 'varchar',
        'length' => 128,
        'not null' => TRUE,
        'default' => '',
        'description' => 'The id of the importer that logged the event.',
      ),
      'feed_nid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'description' => 'Node id of the source, if available.',
      ),
      'log_time' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => 'Unix timestamp of when event occurred.',
      ),
      'request_time' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => 'Unix timestamp of the request when the event occurred.',
      ),
      'type' => array(
        'type' => 'varchar',
        'length' => 64,
        'not null' => TRUE,
        'default' => '',
        'description' => 'Type of log message, for example "feeds_import"."',
      ),
      'message' => array(
        'type' => 'text',
        'not null' => TRUE,
        'size' => 'big',
        'description' => 'Text of log message to be passed into the t() function.',
      ),
      'variables' => array(
        'type' => 'blob',
        'not null' => TRUE,
        'size' => 'big',
        'description' => 'Serialized array of variables that match the message string and that is passed into the t() function.',
      ),
      'severity' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'size' => 'tiny',
        'description' => 'The severity level of the event; ranges from 0 (Emergency) to 7 (Debug)',
      ),
    ),
    'primary key' => array(
      'flid',
    ),
    'indexes' => array(
      'id' => array(
        'id',
      ),
      'id_feed_nid' => array(
        'id',
        'feed_nid',
      ),
      'request_time' => array(
        'request_time',
      ),
      'log_time' => array(
        'log_time',
      ),
      'type' => array(
        'type',
      ),
    ),
  );
  db_create_table('feeds_log', $schema);
}