| 1 |
<?php
|
| 2 |
// $Id: category.schema,v 1.3 2007/08/22 04:11:36 bdragon Exp $
|
| 3 |
|
| 4 |
/**
|
| 5 |
* Implementation of hook_schema().
|
| 6 |
*/
|
| 7 |
function category_schema() {
|
| 8 |
$schema['category'] = array(
|
| 9 |
'fields' => array(
|
| 10 |
'cid' => array('type' => 'int', 'unsigned' => true, 'not null' => true, 'default' => 0),
|
| 11 |
'cnid' => array('type' => 'int', 'unsigned' => true, 'not null' => true, 'default' => 0),
|
| 12 |
'description' => array('type' => 'text', 'not null' => true),
|
| 13 |
'weight' => array('type' => 'int', 'size' => 'tiny', 'not null' => true, 'default' => 0),
|
| 14 |
'depth' => array('type' => 'int', 'size' => 'tiny', 'not null' => true, 'default' => 0),
|
| 15 |
),
|
| 16 |
'primary key' => array('cid'),
|
| 17 |
'indexes' => array(
|
| 18 |
'tid' => array('cnid'),
|
| 19 |
'weight' => array('weight'),
|
| 20 |
),
|
| 21 |
);
|
| 22 |
$schema['category_hierarchy'] = array(
|
| 23 |
'fields' => array(
|
| 24 |
'cid' => array('type' => 'int', 'unsigned' => true, 'not null' => true, 'default' => 0),
|
| 25 |
'parent' => array('type' => 'int', 'unsigned' => true, 'not null' => true, 'default' => 0),
|
| 26 |
),
|
| 27 |
'primary key' => array('cid', 'parent'),
|
| 28 |
'indexes' => array(
|
| 29 |
'nid' => array('cid'), // @@@ This probabaly isn't needed.
|
| 30 |
'parent' => array('parent'),
|
| 31 |
),
|
| 32 |
);
|
| 33 |
$schema['category_node'] = array(
|
| 34 |
'fields' => array(
|
| 35 |
'nid' => array('type' => 'int', 'unsigned' => true, 'not null' => true, 'default' => 0),
|
| 36 |
'cid' => array('type' => 'int', 'unsigned' => true, 'not null' => true, 'default' => 0),
|
| 37 |
),
|
| 38 |
'primary key' => array('cid', 'nid'),
|
| 39 |
'indexes' => array(
|
| 40 |
'nid' => array('nid'),
|
| 41 |
'cid' => array('cid'), // @@@ This probabaly isn't needed.
|
| 42 |
),
|
| 43 |
);
|
| 44 |
$schema['category_relation'] = array(
|
| 45 |
'fields' => array(
|
| 46 |
'cid1' => array('type' => 'int', 'unsigned' => true, 'not null' => true, 'default' => 0),
|
| 47 |
'cid2' => array('type' => 'int', 'unsigned' => true, 'not null' => true, 'default' => 0),
|
| 48 |
),
|
| 49 |
//'primary key' => array(),
|
| 50 |
'indexes' => array(
|
| 51 |
'cid1' => array('cid1'),
|
| 52 |
'cid2' => array('cid2'),
|
| 53 |
),
|
| 54 |
);
|
| 55 |
$schema['category_synonym'] = array(
|
| 56 |
'fields' => array(
|
| 57 |
'cid' => array('type' => 'int', 'unsigned' => true, 'not null' => true, 'default' => 0),
|
| 58 |
'name' => array('type' => 'varchar', 'length' => 255, 'not null' => true, 'default' => ''),
|
| 59 |
),
|
| 60 |
'indexes' => array(
|
| 61 |
'nid' => array('cid'),
|
| 62 |
'name' => array(array('name', 3)),
|
| 63 |
),
|
| 64 |
);
|
| 65 |
$schema['category_cont'] = array(
|
| 66 |
'fields' => array(
|
| 67 |
'cid' => array('type' => 'int', 'unsigned' => true, 'not null' => true, 'default' => 0),
|
| 68 |
'admin_title' => array('type' => 'varchar', 'length' => 128, 'not null' => true, 'default' => ''),
|
| 69 |
'help' => array('type' => 'varchar', 'length' => 255, 'not null' => true, 'default' => ''),
|
| 70 |
'module' => array('type' => 'varchar', 'length' => 255, 'not null' => true, 'default' => ''),
|
| 71 |
'has_relations' => array('type' => 'int', 'size' => 'tiny', 'not null' => true, 'default' => 0),
|
| 72 |
'has_synonyms' => array('type' => 'int', 'size' => 'tiny', 'not null' => true, 'default' => 0),
|
| 73 |
'hierarchy' => array('type' => 'int', 'size' => 'tiny', 'not null' => true, 'default' => 0),
|
| 74 |
'multiple' => array('type' => 'int', 'size' => 'tiny', 'not null' => true, 'default' => 0),
|
| 75 |
'required' => array('type' => 'int', 'size' => 'tiny', 'not null' => true, 'default' => 0),
|
| 76 |
'tags' => array('type' => 'int', 'size' => 'tiny', 'not null' => true, 'default' => 0),
|
| 77 |
'hidden_cont' => array('type' => 'int', 'size' => 'tiny', 'not null' => true, 'default' => 0),
|
| 78 |
),
|
| 79 |
'primary key' => array('cid'),
|
| 80 |
);
|
| 81 |
$schema['category_cont_distant'] = array(
|
| 82 |
'fields' => array(
|
| 83 |
'cid' => array('type' => 'int', 'unsigned' => true, 'not null' => true, 'default' => 0),
|
| 84 |
'allowed_parent' => array('type' => 'varchar', 'length' => 255, 'not null' => true, 'default' => ''),
|
| 85 |
),
|
| 86 |
'primary key' => array('cid', 'allowed_parent'),
|
| 87 |
'indexes' => array(
|
| 88 |
'nid' => array('cid'), // @@@ Probabaly not needed
|
| 89 |
'allowed_parent' => array('allowed_parent'),
|
| 90 |
),
|
| 91 |
);
|
| 92 |
$schema['category_cont_node_types'] = array(
|
| 93 |
'fields' => array(
|
| 94 |
'cid' => array('type' => 'int', 'unsigned' => true, 'not null' => true, 'default' => 0),
|
| 95 |
'type' => array('type' => 'varchar', 'length' => 32, 'not null' => true, 'default' => ''), // @@@ Stupid
|
| 96 |
),
|
| 97 |
'primary key' => array('cid', 'type'), // @@@ REALLY stupid
|
| 98 |
);
|
| 99 |
$schema['category_content_type_settings'] = array(
|
| 100 |
'fields' => array(
|
| 101 |
'type' => array('type' => 'varchar', 'length' => 32, 'not null' => true, 'default' => ''),
|
| 102 |
'behavior' => array('type' => 'varchar', 'length' => 32, 'not null' => true, 'default' => 'none'),
|
| 103 |
'invert_allowed_containers' => array('type' => 'int', 'size' => 'tiny', 'not null' => true, 'default' => 1),
|
| 104 |
),
|
| 105 |
'primary key' => array('type'),
|
| 106 |
);
|
| 107 |
// Containers that a category of a specific content type can be in.
|
| 108 |
$schema['category_content_type_allowed_containers'] = array(
|
| 109 |
'fields' => array(
|
| 110 |
'type' => array('type' => 'varchar', 'length' => 32, 'not null' => true, 'default' => ''),
|
| 111 |
'cnid' => array('type' => 'int', 'unsigned' => true, 'not null' => true, 'default' => 0),
|
| 112 |
),
|
| 113 |
'primary key' => array('type', 'cnid'),
|
| 114 |
);
|
| 115 |
return $schema;
|
| 116 |
} |