2007-04-10 10:10:27 +00:00
|
|
|
<?php
|
|
|
|
// $Id$
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Implementation of hook_install().
|
|
|
|
*/
|
|
|
|
function dblog_install() {
|
2007-05-25 12:46:46 +00:00
|
|
|
// Create tables.
|
|
|
|
drupal_install_schema('dblog');
|
2007-04-10 10:10:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Implementation of hook_uninstall().
|
|
|
|
*/
|
|
|
|
function dblog_uninstall() {
|
2007-05-25 12:46:46 +00:00
|
|
|
// Remove tables.
|
|
|
|
drupal_uninstall_schema('dblog');
|
2007-04-10 10:10:27 +00:00
|
|
|
}
|
2007-10-05 14:43:26 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Implementation of hook_schema().
|
|
|
|
*/
|
|
|
|
function dblog_schema() {
|
|
|
|
$schema['watchdog'] = array(
|
|
|
|
'fields' => array(
|
|
|
|
'wid' => array('type' => 'serial', 'not null' => TRUE),
|
|
|
|
'uid' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
|
|
|
|
'type' => array('type' => 'varchar', 'length' => 16, 'not null' => TRUE, 'default' => ''),
|
|
|
|
'message' => array('type' => 'text', 'not null' => TRUE, 'size' => 'big'),
|
|
|
|
'variables' => array('type' => 'text', 'not null' => TRUE, 'size' => 'big'),
|
|
|
|
'severity' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, 'size' => 'tiny'),
|
|
|
|
'link' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''),
|
|
|
|
'location' => array('type' => 'text', 'not null' => TRUE),
|
|
|
|
'referer' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''),
|
|
|
|
'hostname' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''),
|
|
|
|
'timestamp' => array('type' => 'int', 'not null' => TRUE, 'default' => 0)
|
|
|
|
),
|
|
|
|
'primary key' => array('wid'),
|
|
|
|
'indexes' => array('type' => array('type')),
|
|
|
|
);
|
|
|
|
|
|
|
|
return $schema;
|
|
|
|
}
|
|
|
|
|