| 1 |
<?php
|
| 2 |
// $Id$
|
| 3 |
|
| 4 |
/**
|
| 5 |
* @file
|
| 6 |
* Epublish installation file.
|
| 7 |
*/
|
| 8 |
|
| 9 |
/**
|
| 10 |
* Implementation of hook_install().
|
| 11 |
*/
|
| 12 |
function epublish_install() {
|
| 13 |
drupal_install_schema('epublish');
|
| 14 |
}
|
| 15 |
|
| 16 |
/**
|
| 17 |
* Implementation of hook_uninstall().
|
| 18 |
*/
|
| 19 |
function epublish_uninstall() {
|
| 20 |
drupal_uninstall_schema('epublish');
|
| 21 |
}
|
| 22 |
|
| 23 |
/**
|
| 24 |
* Implementation of hook_schema().
|
| 25 |
*/
|
| 26 |
function epublish_schema() {
|
| 27 |
$schema['epublish_publication'] = array(
|
| 28 |
'fields' => array(
|
| 29 |
'pid' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE, 'length' => 10),
|
| 30 |
'name' => array('type' => 'varchar', 'not null' => TRUE, 'default' => '', 'length' => 128),
|
| 31 |
'description' => array('type' => 'text', 'not null' => TRUE, 'size' => 'big'),
|
| 32 |
'schedule' => array('type' => 'varchar', 'not null' => TRUE, 'default' => '', 'length' => 128),
|
| 33 |
'current_eid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, 'length' => 10),
|
| 34 |
'layout_list' => array('type' => 'varchar', 'not null' => TRUE, 'default' => '', 'length' => 128),
|
| 35 |
'layout_page' => array('type' => 'varchar', 'not null' => TRUE, 'default' => '', 'length' => 128),
|
| 36 |
'sid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, 'length' => 10)
|
| 37 |
),
|
| 38 |
'primary key' => array('pid'),
|
| 39 |
);
|
| 40 |
|
| 41 |
$schema['epublish_abstract'] = array(
|
| 42 |
'fields' => array(
|
| 43 |
'nid' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'length' => 10),
|
| 44 |
'epublish_abstract' => array('type' => 'text', 'not null' => TRUE, 'size' => 'big'),
|
| 45 |
'use_as_teaser' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'length' => 2)
|
| 46 |
),
|
| 47 |
'unique keys' => array(
|
| 48 |
'nid' => array('nid')
|
| 49 |
),
|
| 50 |
);
|
| 51 |
|
| 52 |
$schema['epublish_edition'] = array(
|
| 53 |
'fields' => array(
|
| 54 |
'eid' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE, 'length' => 10),
|
| 55 |
'pid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, 'length' => 10),
|
| 56 |
'dateline' => array('type' => 'varchar', 'not null' => TRUE, 'default' => '', 'length' => 128),
|
| 57 |
'description' => array('type' => 'text', 'not null' => TRUE, 'size' => 'big'),
|
| 58 |
'volume' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'length' => 10),
|
| 59 |
'number' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'length' => 10),
|
| 60 |
'pubdate' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'length' => 8),
|
| 61 |
'layout_list' => array('type' => 'varchar', 'not null' => TRUE, 'default' => '', 'length' => 128),
|
| 62 |
'layout_page' => array('type' => 'varchar', 'not null' => TRUE, 'default' => '', 'length' => 128),
|
| 63 |
'sid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, 'length' => 10),
|
| 64 |
'published' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'length' => 4)
|
| 65 |
),
|
| 66 |
'indexes' => array(
|
| 67 |
'pid' => array('pid')
|
| 68 |
),
|
| 69 |
'primary key' => array('eid'),
|
| 70 |
);
|
| 71 |
|
| 72 |
$schema['epublish_edition_node'] = array(
|
| 73 |
'fields' => array(
|
| 74 |
'eid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, 'length' => 10),
|
| 75 |
'nid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, 'length' => 10),
|
| 76 |
'weight' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny', 'length' => 4),
|
| 77 |
'tid' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'length' => 10)
|
| 78 |
),
|
| 79 |
'indexes' => array(
|
| 80 |
'eid' => array('eid', 'nid'),
|
| 81 |
'tid' => array('tid'),
|
| 82 |
'nid' => array('nid')
|
| 83 |
),
|
| 84 |
);
|
| 85 |
|
| 86 |
$schema['epublish_section'] = array(
|
| 87 |
'fields' => array(
|
| 88 |
'sid' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE, 'length' => 10),
|
| 89 |
'title' => array('type' => 'varchar', 'not null' => TRUE, 'default' => '', 'length' => 128),
|
| 90 |
'vid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, 'length' => 10),
|
| 91 |
'node_types' => array('type' => 'text', 'size' => 'big'),
|
| 92 |
'timeframe' => array('type' => 'varchar', 'not null' => TRUE, 'default' => '', 'length' => 16),
|
| 93 |
'layout_list' => array('type' => 'varchar', 'not null' => TRUE, 'default' => '', 'length' => 128),
|
| 94 |
'layout_page' => array('type' => 'varchar', 'not null' => TRUE, 'default' => '', 'length' => 128),
|
| 95 |
'weight' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny', 'length' => 4)
|
| 96 |
),
|
| 97 |
'primary key' => array('sid'),
|
| 98 |
);
|
| 99 |
|
| 100 |
$schema['epublish_topic'] = array(
|
| 101 |
'fields' => array(
|
| 102 |
'sid' => array('type' => 'int', 'unsigned' => TRUE , 'not null' => TRUE, 'default' => 0, 'length' => 10),
|
| 103 |
'tid' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'length' => 10),
|
| 104 |
'count' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 1, 'length' => 2),
|
| 105 |
'weight' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny', 'length' => 4),
|
| 106 |
'node_types' => array('type' => 'text', 'size' => 'big')
|
| 107 |
),
|
| 108 |
'indexes' => array(
|
| 109 |
'tid' => array('tid'),
|
| 110 |
'htid' => array('sid')
|
| 111 |
),
|
| 112 |
);
|
| 113 |
$schema['epublish_volume'] = array(
|
| 114 |
'fields' => array(
|
| 115 |
'pid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, 'length' => 10),
|
| 116 |
'volume' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, 'length' => 10),
|
| 117 |
'dateline' => array('type' => 'varchar', 'not null' => TRUE, 'default' => '', 'length' => 128)
|
| 118 |
),
|
| 119 |
'indexes' => array(
|
| 120 |
'volume' => array('volume'),
|
| 121 |
'pid' => array('pid')
|
| 122 |
),
|
| 123 |
);
|
| 124 |
|
| 125 |
return $schema;
|
| 126 |
}
|
| 127 |
|
| 128 |
|
| 129 |
function epublish_update_1() {
|
| 130 |
return _system_update_utf8(array('epublish_abstract', 'epublish_edition', 'epublish_edition_node', 'epublish_publication', 'epublish_section', 'epublish_topic', 'epublish_volume'));
|
| 131 |
}
|
| 132 |
|