forked from pinedrop/biblio-zotero
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbiblio_zotero.install
53 lines (48 loc) · 1.3 KB
/
biblio_zotero.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
<?php
function biblio_zotero_install() {
biblio_zotero_set_system_weight();
}
/**
* Set system weight to 10 (one higher than biblio)
**/
function biblio_zotero_update_7000() {
biblio_zotero_set_system_weight();
}
function biblio_zotero_set_system_weight() {
// biblio module weight is 9 so let's set our weight one higher so that our
// hook_feeds_processor_targets_alter functions can override those in biblio
db_update('system')
->fields(array(
'weight' => 10,
))
->condition('name', 'biblio_zotero')
->execute();
return;
}
function biblio_zotero_schema() {
$schema['biblio_zotero_collections'] = array(
'fields' => array(
'tid' => array(
'type' => 'int',
'not null' => TRUE,
'unsigned' => TRUE,
'default' => 0,
'description' => 'The taxonomy id of the collection',
),
'collection_key' => array(
'type' => 'varchar',
'not null' => FALSE,
'length' => '128',
'description' => 'The key of the collection in Zotero',
),
)
);
return $schema;
}
/**
* Create new database table {biblio_zotero_collections}.
*/
function biblio_zotero_update_7001() {
$schema = biblio_zotero_schema();
db_create_table('biblio_zotero_collections', $schema['biblio_zotero_collections']);
}