a2d828aa2540de416f5e36764b8efa165c123103
[mkdru-moved-to-drupal.org.git] / mkdru.install
1 <?php
2 // $Id$
3 /**
4  * @file
5  * Install, update and uninstall functions.
6  */
7
8 /**
9 * Implementation of hook_schema().
10 */
11 function mkdru_schema() {
12   $schema['mkdru'] = array(
13     'description' => t('Stores settings for mkdru nodes.'),
14     'fields' => array (
15       'nid' => array(
16         'description' => t('The primary identifier for a node.'),
17         'type' => 'int',
18         'unsigned' => TRUE,
19         'not null' => TRUE,
20         'default' => 0
21        ),
22       'vid' => array(
23         'description' => t('The current {node_revisions}.vid version identifier.'),
24         'type' => 'int',
25         'unsigned' => TRUE,
26         'not null' => TRUE,
27         'default' => 0
28       ),
29       'pz2_path' => array(
30         'type' => 'text',
31         'not null' => TRUE,
32         'description' => t('Path to Pazpar2 or Service Proxy.')
33       ),
34       'use_sessions' => array(
35         'description' => t('Session handling toggle.'),
36         'type' => 'int',
37         'unsigned' => TRUE,
38         'not null' => TRUE,
39       ),
40       'source_max' => array(
41         'description' => t('Number of sources to display'),
42         'type' => 'int',
43         'unsigned' => TRUE,
44         'not null' => TRUE,
45       ),
46       'author_max' => array(
47         'description' => t('Number of authors to display'),
48         'type' => 'int',
49         'unsigned' => TRUE,
50         'not null' => TRUE,
51       ),
52       'subject_max' => array(
53         'description' => t('Number of subjects to display'),
54         'type' => 'int',
55         'unsigned' => TRUE,
56         'not null' => TRUE,
57       ),
58     ),
59     'primary key' => array('nid', 'vid'),
60     'unique keys' => array('vid' => array('vid')),
61     'indexes' => array('nid' => array('nid')),
62   );
63   return $schema;
64 }
65
66 /**
67 * Implementation of hook_install().
68 */
69 function mkdru_install() {
70   // Disable comments by default
71   variable_set('comment_mkdru', COMMENT_NODE_DISABLED);
72   // Create table.
73   drupal_install_schema('mkdru');
74 }
75
76 /**
77 * Implementation of hook_uninstall().
78 */
79 function mkdru_uninstall() {
80   // Drop table.
81   drupal_uninstall_schema('mkdru');
82 }
83 ?>