Code coverage for /20080809/modules/dblog/dblog.install

Line #Times calledCode
1
<?php
2
// $Id: dblog.install,v 1.7 2008/03/15 12:31:28 dries Exp $
3
4
/**
5
 * Implementation of hook_install().
6
 */
780
function dblog_install() {
8
  // Create tables.
962
  drupal_install_schema('dblog');
1062
}
11
12
/**
13
 * Implementation of hook_uninstall().
14
 */
1580
function dblog_uninstall() {
16
  // Remove tables.
170
  drupal_uninstall_schema('dblog');
180
}
19
20
/**
21
 * Implementation of hook_schema().
22
 */
2380
function dblog_schema() {
2477
  $schema['watchdog'] = array(
2577
    'description' => t('Table that contains logs of all system events.'),
26
    'fields' => array(
27
      'wid' => array(
2877
        'type' => 'serial',
2977
        'not null' => TRUE,
3077
        'description' => t('Primary Key: Unique watchdog event ID.'),
3177
      ),
32
      'uid' => array(
3377
        'type' => 'int',
3477
        'not null' => TRUE,
3577
        'default' => 0,
3677
        'description' => t('The {users}.uid of the user who triggered the
event.'),
3777
      ),
38
      'type' => array(
3977
        'type' => 'varchar',
4077
        'length' => 16,
4177
        'not null' => TRUE,
4277
        'default' => '',
4377
        'description' => t('Type of log message, for example "user" or
"page not found."'),
4477
      ),
45
      'message' => array(
4677
        'type' => 'text',
4777
        'not null' => TRUE,
4877
        'size' => 'big',
4977
        'description' => t('Text of log message to be passed into the t()
function.'),
5077
      ),
51
      'variables' => array(
5277
        'type' => 'text',
5377
        'not null' => TRUE,
5477
        'size' => 'big',
5577
        'description' => t('Serialized array of variables that match the
message string and that is passed into the t() function.'),
5677
      ),
57
      'severity' => array(
5877
        'type' => 'int',
5977
        'unsigned' => TRUE,
6077
        'not null' => TRUE,
6177
        'default' => 0,
6277
        'size' => 'tiny',
6377
        'description' => t('The severity level of the event; ranges from 0
(Emergency) to 7 (Debug)'),
6477
      ),
65
      'link' => array(
6677
        'type' => 'varchar',
6777
        'length' => 255,
6877
        'not null' => TRUE,
6977
        'default' => '',
7077
        'description' => t('Link to view the result of the event.'),
7177
      ),
72
      'location'  => array(
7377
        'type' => 'text',
7477
        'not null' => TRUE,
7577
        'description' => t('URL of the origin of the event.'),
7677
      ),
77
      'referer' => array(
7877
        'type' => 'varchar',
7977
        'length' => 128,
8077
        'not null' => TRUE,
8177
        'default' => '',
8277
        'description' => t('URL of referring page.'),
8377
      ),
84
      'hostname' => array(
8577
        'type' => 'varchar',
8677
        'length' => 128,
8777
        'not null' => TRUE,
8877
        'default' => '',
8977
        'description' => t('Hostname of the user who triggered the
event.'),
9077
      ),
91
      'timestamp' => array(
9277
        'type' => 'int',
9377
        'not null' => TRUE,
9477
        'default' => 0,
9577
        'description' => t('Unix timestamp of when event occurred.'),
9677
      ),
9777
    ),
9877
    'primary key' => array('wid'),
99
    'indexes' => array(
10077
      'type' => array('type'),
10177
    ),
102
  );
103
10477
  return $schema;
1050
}
10680