You are here

function log_filter_schema in Log Filter 7

Implements hook_schema().

Return value

array

File

./log_filter.install, line 57
Drupal Log Filter module (un)installation

Code

function log_filter_schema() {
  return array(
    'log_filter' => array(
      'description' => 'Log filters.',
      'fields' => array(
        'id' => array(
          'type' => 'serial',
          'not null' => TRUE,
        ),
        'name' => array(
          'type' => 'varchar',
          'length' => 32,
          'not null' => TRUE,
        ),
        'creator' => array(
          'type' => 'int',
          'not null' => TRUE,
          'description' => 'The user.uid that created the filter.',
        ),
        'description' => array(
          'type' => 'varchar',
          'length' => 255,
          'not null' => TRUE,
          'default' => '',
        ),
        'require_admin' => array(
          'type' => 'int',
          'size' => 'tiny',
          'not null' => TRUE,
          'default' => 0,
          'description' => 'Require the \'Administer log filtering\' role.',
        ),
        'severity' => array(
          'type' => 'varchar',
          'length' => 255,
          'not null' => TRUE,
          'default' => '',
          'description' => 'Comma-separated list.',
        ),
        'type' => array(
          'type' => 'text',
          'not null' => TRUE,
          //  Text fields don't support default value; at least not MySQL.
          'description' => 'Comma-separated list. Empty default because it\'s a text field (not char/varchar).',
        ),
        'time_range' => array(
          'type' => 'int',
          'not null' => TRUE,
          'default' => 0,
        ),
        'time_from' => array(
          'type' => 'int',
          'not null' => TRUE,
          'default' => 0,
        ),
        'time_to' => array(
          'type' => 'int',
          'not null' => TRUE,
          'default' => 0,
        ),
        'role' => array(
          'type' => 'int',
          'not null' => TRUE,
          'default' => -1,
        ),
        'uid' => array(
          'type' => 'int',
          'not null' => TRUE,
          'default' => -1,
        ),
        'hostname' => array(
          'type' => 'varchar',
          'length' => 255,
          'not null' => TRUE,
          'default' => '',
        ),
        'location' => array(
          'type' => 'varchar',
          'length' => 255,
          'not null' => TRUE,
          'default' => '',
        ),
        'referer' => array(
          'type' => 'varchar',
          'length' => 255,
          'not null' => TRUE,
          'default' => '',
          'description' => 'Url, \'none\' or empty.',
        ),
        'order_by' => array(
          'type' => 'varchar',
          'length' => 255,
          'not null' => TRUE,
          'default' => 'time:DESC',
          'description' => 'Comma-separated list, like: \'time:DESC,severity:ASC\'.',
        ),
        'editor' => array(
          'type' => 'int',
          'not null' => TRUE,
          'description' => 'The user.uid that most recently changed (or created) the filter.',
        ),
        'created' => array(
          'type' => 'int',
          'not null' => TRUE,
          'description' => 'The Unix timestamp when the filter was created.',
        ),
        'changed' => array(
          'type' => 'int',
          'not null' => TRUE,
          'description' => 'The Unix timestamp when the filter was most recently saved.',
        ),
      ),
      'primary key' => array(
        'id',
      ),
      'unique keys' => array(
        'name' => array(
          'name',
        ),
      ),
    ),
  );
}