This repository has been archived on 2025-01-19. You can view files and clone it, but cannot push or open issues or pull requests.
drupalcampbristol/web/core/modules/dblog/dblog.install

93 lines
2.5 KiB
Plaintext
Raw Normal View History

<?php
/**
* @file
* Install, update and uninstall functions for the dblog module.
*/
/**
* Implements hook_schema().
*/
function dblog_schema() {
2017-04-13 14:53:35 +00:00
$schema['watchdog'] = [
'description' => 'Table that contains logs of all system events.',
2017-04-13 14:53:35 +00:00
'fields' => [
'wid' => [
'type' => 'serial',
'not null' => TRUE,
'description' => 'Primary Key: Unique watchdog event ID.',
2017-04-13 14:53:35 +00:00
],
'uid' => [
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
'description' => 'The {users}.uid of the user who triggered the event.',
2017-04-13 14:53:35 +00:00
],
'type' => [
'type' => 'varchar_ascii',
'length' => 64,
'not null' => TRUE,
'default' => '',
'description' => 'Type of log message, for example "user" or "page not found."',
2017-04-13 14:53:35 +00:00
],
'message' => [
'type' => 'text',
'not null' => TRUE,
'size' => 'big',
'description' => 'Text of log message to be passed into the t() function.',
2017-04-13 14:53:35 +00:00
],
'variables' => [
'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.',
2017-04-13 14:53:35 +00:00
],
'severity' => [
'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)',
2017-04-13 14:53:35 +00:00
],
'link' => [
'type' => 'text',
'not null' => FALSE,
'description' => 'Link to view the result of the event.',
2017-04-13 14:53:35 +00:00
],
'location' => [
'type' => 'text',
'not null' => TRUE,
'description' => 'URL of the origin of the event.',
2017-04-13 14:53:35 +00:00
],
'referer' => [
'type' => 'text',
'not null' => FALSE,
'description' => 'URL of referring page.',
2017-04-13 14:53:35 +00:00
],
'hostname' => [
'type' => 'varchar_ascii',
'length' => 128,
'not null' => TRUE,
'default' => '',
'description' => 'Hostname of the user who triggered the event.',
2017-04-13 14:53:35 +00:00
],
'timestamp' => [
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'description' => 'Unix timestamp of when event occurred.',
2017-04-13 14:53:35 +00:00
],
],
'primary key' => ['wid'],
'indexes' => [
'type' => ['type'],
'uid' => ['uid'],
'severity' => ['severity'],
],
];
return $schema;
}