1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
<?php
// $Id$
/**
* Implementation of hook_install().
*/
function drupal_install() {
// Create tables.
drupal_install_schema('drupal');
}
/**
* Implementation of hook_uninstall().
*/
function drupal_uninstall() {
// Remove tables.
drupal_uninstall_schema('drupal');
variable_del('drupal_authentication_service');
variable_del('drupal_directory');
variable_del('drupal_register');
variable_del('drupal_server');
variable_del('drupal_system');
variable_del('drupal_statistics');
variable_del('drupal_client_service');
variable_del('drupal_default_da_server');
variable_del('drupal_default_da_server_only');
}
/**
* Implementation of hook_schema().
*/
function drupal_schema() {
$schema['client'] = array(
'fields' => array(
'cid' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE),
'link' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''),
'name' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''),
'mail' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''),
'slogan' => array('type' => 'text', 'not null' => TRUE, 'size' => 'big'),
'mission' => array('type' => 'text', 'not null' => TRUE, 'size' => 'big'),
'users' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
'nodes' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
'version' => array('type' => 'varchar', 'length' => 35, 'not null' => TRUE, 'default' => ''),
'created' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
'changed' => array('type' => 'int', 'not null' => TRUE, 'default' => 0)
),
'primary key' => array('cid'),
);
$schema['client_system'] = array(
'fields' => array(
'cid' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
'name' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''),
'type' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => '')
),
'primary key' => array('cid', 'name'),
);
return $schema;
}
|