forked from kraftwagen/kw-itemnames
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkw_itemnames.install
40 lines (37 loc) · 1.19 KB
/
kw_itemnames.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
<?php
/**
* Implements hook_schema().
*/
function kw_itemnames_schema() {
$schema = array();
$schema['kw_itemnames'] = array(
'description' => 'Stores the names that are assigned to kw_itemnames managed items',
'fields' => array(
'type' => array(
'description' => 'The type of item for which we registered the name',
'type' => 'varchar',
'length' => 32,
'default' => '',
'not null' => TRUE,
),
'name' => array(
'description' => 'The name that is assigned to the item',
'type' => 'varchar',
'length' => 64, // 64 ought to be enough for everybody
'default' => '',
'not null' => TRUE
),
'item_id' => array(
'description' => 'The internal ID of the item this name points to',
'type' => 'int', // this is not intended for items that already have a unique string ID
'default' => 0,
'not null' => TRUE,
),
),
'unique keys' => array(
'item' => array('type', 'item_id'), // you can't assign two names to one item
),
'primary key' => array('type', 'name'), // you can't assign a name to two items of the same type
);
return $schema;
}