adb.install 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <?php
  2. /**
  3. * Implements hook_schema().
  4. */
  5. function adb_schema() {
  6. $schema['adb'] = array(
  7. 'description' => 'Table that contains logs of all system events.',
  8. 'fields' => array(
  9. 'adbid' => array(
  10. 'type' => 'serial',
  11. 'not null' => TRUE,
  12. 'description' => 'Primary Key: Unique access deneid backtrace event ID.',
  13. ),
  14. 'uid' => array(
  15. 'type' => 'int',
  16. 'not null' => TRUE,
  17. 'default' => 0,
  18. 'description' => 'The {users}.uid of the user who triggered the event.',
  19. ),
  20. 'location' => array(
  21. 'type' => 'text',
  22. 'not null' => TRUE,
  23. 'description' => 'URL of the origin of the event.',
  24. ),
  25. 'node_access_denied' => array(
  26. 'type' => 'text',
  27. 'not null' => FALSE,
  28. 'size' => 'medium',
  29. 'description' => 'User permissions.',
  30. ),
  31. 'permissions' => array(
  32. 'type' => 'text',
  33. 'not null' => FALSE,
  34. 'size' => 'medium',
  35. 'description' => 'User permissions.',
  36. ),
  37. 'role_permissions' => array(
  38. 'type' => 'text',
  39. 'not null' => FALSE,
  40. 'size' => 'medium',
  41. 'description' => 'role permissions.',
  42. ),
  43. 'backtrace' => array(
  44. 'type' => 'text',
  45. 'not null' => TRUE,
  46. 'size' => 'big',
  47. 'description' => 'Text of backtrace log execution.',
  48. ),
  49. 'timestamp' => array(
  50. 'type' => 'int',
  51. 'not null' => TRUE,
  52. 'default' => 0,
  53. 'description' => 'Unix timestamp of when event occurred.',
  54. ),
  55. ),
  56. 'primary key' => array('adbid'),
  57. 'indexes' => array(
  58. 'uid' => array('uid'),
  59. ),
  60. );
  61. return $schema;
  62. }
  63. /**
  64. * Add field permissions in table adb.
  65. */
  66. function adb_update_7150() {
  67. db_add_field('adb', 'permissions', array('type' => 'text', 'not null' => FALSE, 'size' => 'medium'));
  68. return t('Added permissions column to adb table.');
  69. }
  70. /**
  71. * Add fields role_permissiones and node_access_denied in table adb.
  72. */
  73. function adb_update_7160() {
  74. db_add_field('adb', 'role_permissions', array('type' => 'text', 'not null' => FALSE, 'size' => 'medium'));
  75. db_add_field('adb', 'node_access_denied', array('type' => 'text', 'not null' => FALSE, 'size' => 'medium'));
  76. return t('Added role_permissions and node_access_denied columns to adb table.');
  77. }