| 1 |
<?php
|
| 2 |
// $Id$
|
| 3 |
|
| 4 |
function composite_schema() {
|
| 5 |
$schema['node_composite'] = array(
|
| 6 |
'description' => t('Base table for Composite Node module. '),
|
| 7 |
'fields' => array(
|
| 8 |
'nid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, 'disp-width' => '10'),
|
| 9 |
'vid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, 'disp-width' => '10'),
|
| 10 |
'layout' => array('type' => 'varchar', 'length' => '255', 'not null' => TRUE, 'default' => ''),
|
| 11 |
// data contains additional settings
|
| 12 |
'data' => array('type' => 'text', 'size' => 'medium', 'not null' => TRUE, 'serialize' => TRUE),
|
| 13 |
),
|
| 14 |
'indexes' => array(
|
| 15 |
'nid' => array('nid'),
|
| 16 |
),
|
| 17 |
'primary key' => array('vid'),
|
| 18 |
);
|
| 19 |
|
| 20 |
$schema['node_composite_references'] = array(
|
| 21 |
'description' => t('References table for Composite Node module. '),
|
| 22 |
'fields' => array(
|
| 23 |
'nid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, 'disp-width' => '10'),
|
| 24 |
'vid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, 'disp-width' => '10'),
|
| 25 |
'type' => array('type' => 'varchar', 'length' => '255', 'not null' => TRUE, 'default' => ''),
|
| 26 |
'weight' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'disp-width' => '11'),
|
| 27 |
// id identifies the thing (ie. node, block etc.) to display
|
| 28 |
'id' => array('type' => 'varchar', 'length' => '255', 'not null' => TRUE, 'default' => ''),
|
| 29 |
// data contains additional settings
|
| 30 |
'data' => array('type' => 'text', 'size' => 'medium', 'not null' => TRUE, 'serialize' => TRUE),
|
| 31 |
// these fields follow {blocks}
|
| 32 |
'zone' => array('type' => 'varchar', 'length' => '64', 'not null' => TRUE, 'default' => ''),
|
| 33 |
// 'visibility' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'disp-width' => '4'),
|
| 34 |
// 'pages' => array('type' => 'text', 'not null' => TRUE, 'default' => ''),
|
| 35 |
// 'title' => array('type' => 'varchar', 'length' => '255', 'not null' => TRUE, 'default' => ''),
|
| 36 |
),
|
| 37 |
/*
|
| 38 |
'indexes' => array(
|
| 39 |
'nid' => array('nid'),
|
| 40 |
),
|
| 41 |
*/
|
| 42 |
'primary key' => array('vid, id'),
|
| 43 |
);
|
| 44 |
|
| 45 |
return $schema;
|
| 46 |
}
|
| 47 |
|
| 48 |
/**
|
| 49 |
* Implementation of hook_install().
|
| 50 |
*/
|
| 51 |
function composite_install() {
|
| 52 |
drupal_install_schema('composite');
|
| 53 |
}
|
| 54 |
|
| 55 |
/**
|
| 56 |
* Implementation of hook_uninstall().
|
| 57 |
*/
|
| 58 |
function composite_uninstall() {
|
| 59 |
drupal_uninstall_schema('composite');
|
| 60 |
variable_del('composite_extra_config');
|
| 61 |
}
|
| 62 |
|
| 63 |
|