forked from benthebear/Semantic-Weblog
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsemanticweblog.install
executable file
·126 lines (120 loc) · 3.42 KB
/
semanticweblog.install
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<?php
// $Id$
/**
* @file:
* Installation und Unstallation of the modules Tables
*
* @author Benjamin Birkenhake <[email protected]>
* @package semanticweblog
*
*/
/**
* Implementation of hook_install().
*/
function semanticweblog_install() {
// Create tables.
drupal_install_schema('semanticweblog');
}
/**
* Implementation of hook_uninstall().
*/
function semanticweblog_uninstall() {
// Remove tables.
drupal_uninstall_schema('semanticweblog');
// Remove settings
variable_del('semanticweblog_admin_associations_display');
variable_del('semanticweblog_admin_associations_pager');
variable_del('semanticweblog_admin_associations_position');
variable_del('semanticweblog_bulk_separator');
variable_del('semanticweblog_lexicon');
}
/**
* Implementation of hook_schema().
*/
function semanticweblog_schema() {
$schema['semanticweblog_types'] = array(
'description' => t('Stores association types.'),
'fields' => array(
'atid' => array(
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
'description' => t('Primary key: ID.'),
),
'name' => array(
'type' => 'text',
'not null' => FALSE,
'size' => 'big',
'description' => t('The name of the association type'),
),
'role1' => array(
'type' => 'text',
'not null' => FALSE,
'size' => 'big',
'description' => t('The role of the first memeber of the association type'),
),
'role2' => array(
'type' => 'text',
'not null' => FALSE,
'size' => 'big',
'description' => t('The role of the second memeber of the association type'),
),
'sentence' => array(
'type' => 'text',
'not null' => FALSE,
'size' => 'big',
'description' => t('The sentence to be formed by this association type'),
),
),
'primary key' => array('atid')
);
$schema['semanticweblog_associations'] = array(
'description' => t('Stores associations.'),
'fields' => array(
'aid' => array(
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
'description' => t('Primary Key: ID.'),
),
'uid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
'description' => t('The user id of the user who created this association.'),
),
'member1tid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
'description' => t('The term id of the first term.'),
),
'atid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
'description' => t('The atid of the association zype.'),
),
'member2tid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
'description' => t('The term of the second term.'),
),
'created' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
'description' => t('The timestamp of the moment of creation of this association'),
),
),
'primary key' => array('aid'),
'indexes' => array('atid' => array('atid'), 'member1tid' => array('member1tid'), 'member2tid' => array('member2tid')),
);
return $schema;
}