dblog.install

  1. drupal
    1. 6 modules/dblog/dblog.install
    2. 7 modules/dblog/dblog.install
    3. 8 core/modules/dblog/dblog.install

Install, update and uninstall functions for the dblog module.

Functions & methods

NameDescription
dblog_schemaImplements hook_schema().
dblog_uninstallImplements hook_uninstall().

File

core/modules/dblog/dblog.install
View source
  1. <?php
  2. /**
  3. * @file
  4. * Install, update and uninstall functions for the dblog module.
  5. */
  6. /**
  7. * Implements hook_schema().
  8. */
  9. function dblog_schema() {
  10. $schema['watchdog'] = array(
  11. 'description' => 'Table that contains logs of all system events.',
  12. 'fields' => array(
  13. 'wid' => array(
  14. 'type' => 'serial',
  15. 'not null' => TRUE,
  16. 'description' => 'Primary Key: Unique watchdog event ID.',
  17. ),
  18. 'uid' => array(
  19. 'type' => 'int',
  20. 'not null' => TRUE,
  21. 'default' => 0,
  22. 'description' => 'The {users}.uid of the user who triggered the event.',
  23. ),
  24. 'type' => array(
  25. 'type' => 'varchar',
  26. 'length' => 64,
  27. 'not null' => TRUE,
  28. 'default' => '',
  29. 'description' => 'Type of log message, for example "user" or "page not found."',
  30. ),
  31. 'message' => array(
  32. 'type' => 'text',
  33. 'not null' => TRUE,
  34. 'size' => 'big',
  35. 'description' => 'Text of log message to be passed into the t() function.',
  36. ),
  37. 'variables' => array(
  38. 'type' => 'blob',
  39. 'not null' => TRUE,
  40. 'size' => 'big',
  41. 'description' => 'Serialized array of variables that match the message string and that is passed into the t() function.',
  42. ),
  43. 'severity' => array(
  44. 'type' => 'int',
  45. 'unsigned' => TRUE,
  46. 'not null' => TRUE,
  47. 'default' => 0,
  48. 'size' => 'tiny',
  49. 'description' => 'The severity level of the event; ranges from 0 (Emergency) to 7 (Debug)',
  50. ),
  51. 'link' => array(
  52. 'type' => 'varchar',
  53. 'length' => 255,
  54. 'not null' => FALSE,
  55. 'default' => '',
  56. 'description' => 'Link to view the result of the event.',
  57. ),
  58. 'location' => array(
  59. 'type' => 'text',
  60. 'not null' => TRUE,
  61. 'description' => 'URL of the origin of the event.',
  62. ),
  63. 'referer' => array(
  64. 'type' => 'text',
  65. 'not null' => FALSE,
  66. 'description' => 'URL of referring page.',
  67. ),
  68. 'hostname' => array(
  69. 'type' => 'varchar',
  70. 'length' => 128,
  71. 'not null' => TRUE,
  72. 'default' => '',
  73. 'description' => 'Hostname of the user who triggered the event.',
  74. ),
  75. 'timestamp' => array(
  76. 'type' => 'int',
  77. 'not null' => TRUE,
  78. 'default' => 0,
  79. 'description' => 'Unix timestamp of when event occurred.',
  80. ),
  81. ),
  82. 'primary key' => array('wid'),
  83. 'indexes' => array(
  84. 'type' => array('type'),
  85. 'uid' => array('uid'),
  86. ),
  87. );
  88. return $schema;
  89. }
  90. /**
  91. * Implements hook_uninstall().
  92. */
  93. function dblog_uninstall() {
  94. variable_del('dblog_row_limit');
  95. }
Login or register to post comments