summaryrefslogtreecommitdiff
path: root/modules/taxonomy/taxonomy.schema
diff options
context:
space:
mode:
Diffstat (limited to 'modules/taxonomy/taxonomy.schema')
-rw-r--r--modules/taxonomy/taxonomy.schema100
1 files changed, 100 insertions, 0 deletions
diff --git a/modules/taxonomy/taxonomy.schema b/modules/taxonomy/taxonomy.schema
new file mode 100644
index 000000000..36d171251
--- /dev/null
+++ b/modules/taxonomy/taxonomy.schema
@@ -0,0 +1,100 @@
+<?php
+// $Id$
+
+function taxonomy_schema() {
+ $schema['term_data'] = array(
+ 'fields' => array(
+ 'tid' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE),
+ 'vid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
+ 'name' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''),
+ 'description' => array('type' => 'text', 'not null' => FALSE, 'size' => 'big'),
+ 'weight' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny')
+ ),
+ 'primary key' => array('tid'),
+ 'indexes' => array('vid' => array('vid')),
+ );
+
+ $schema['term_hierarchy'] = array(
+ 'fields' => array(
+ 'tid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
+ 'parent' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0)
+ ),
+ 'indexes' => array(
+ 'parent' => array('parent'),
+ 'tid' => array('tid')
+ ),
+ 'primary key' => array('tid', 'parent'),
+ );
+
+ $schema['term_node'] = array(
+ 'fields' => array(
+ 'nid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
+ 'vid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
+ 'tid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0)
+ ),
+ 'indexes' => array(
+ 'nid' => array('nid'),
+ 'tid' => array('tid'),
+ 'vid' => array('vid')
+ ),
+ 'primary key' => array(
+ 'vid',
+ 'tid',
+ 'nid'
+ ),
+ );
+
+ $schema['term_relation'] = array(
+ 'fields' => array(
+ 'trid' => array('type' => 'serial', 'not null' => TRUE),
+ 'tid1' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
+ 'tid2' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0)
+ ),
+ 'indexes' => array(
+ 'tid1' => array('tid1'),
+ 'tid2' => array('tid2')
+ ),
+ 'primary key' => array('trid'),
+ );
+
+ $schema['term_synonym'] = array(
+ 'fields' => array(
+ 'tsid' => array('type' => 'serial', 'not null' => TRUE),
+ 'tid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
+ 'name' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => '')
+ ),
+ 'indexes' => array(
+ 'name' => array(array('name', 3)),
+ 'tid' => array('tid')
+ ),
+ 'primary key' => array('tsid'),
+ );
+
+ $schema['vocabulary'] = array(
+ 'fields' => array(
+ 'vid' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE),
+ 'name' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''),
+ 'description' => array('type' => 'text', 'not null' => FALSE, 'size' => 'big'),
+ 'help' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''),
+ 'relations' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, 'size' => 'tiny'),
+ 'hierarchy' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, 'size' => 'tiny'),
+ 'multiple' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, 'size' => 'tiny'),
+ 'required' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, 'size' => 'tiny'),
+ 'tags' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, 'size' => 'tiny'),
+ 'module' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''),
+ 'weight' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny')
+ ),
+ 'primary key' => array('vid'),
+ );
+
+ $schema['vocabulary_node_types'] = array(
+ 'fields' => array(
+ 'vid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
+ 'type' => array('type' => 'varchar', 'length' => 32, 'not null' => TRUE, 'default' => '')
+ ),
+ 'primary key' => array('vid', 'type'),
+ );
+
+ return $schema;
+}
+