summaryrefslogtreecommitdiff
path: root/modules/taxonomy/taxonomy.install
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-06-12 13:59:56 +0000
committerDries Buytaert <dries@buytaert.net>2009-06-12 13:59:56 +0000
commit2bc9e50dbaa83df96090172b3fc682bd9a291588 (patch)
treee698368b8fa1a11e46f47924f76fbd4a526648f5 /modules/taxonomy/taxonomy.install
parentd0936908cbf2f8b6c873e9b4d5a2abe279eb8ab7 (diff)
downloadbrdo-2bc9e50dbaa83df96090172b3fc682bd9a291588.tar.gz
brdo-2bc9e50dbaa83df96090172b3fc682bd9a291588.tar.bz2
- Patch #413192 by catch et al: make taxonomy terms fieldable (not to be confused with taxonomy terms as fields).
Diffstat (limited to 'modules/taxonomy/taxonomy.install')
-rw-r--r--modules/taxonomy/taxonomy.install33
1 files changed, 33 insertions, 0 deletions
diff --git a/modules/taxonomy/taxonomy.install b/modules/taxonomy/taxonomy.install
index 72fb016d3..e43bb0e91 100644
--- a/modules/taxonomy/taxonomy.install
+++ b/modules/taxonomy/taxonomy.install
@@ -226,6 +226,13 @@ function taxonomy_schema() {
'default' => '',
'description' => 'Name of the vocabulary.',
),
+ 'machine_name' => array(
+ 'type' => 'varchar',
+ 'length' => 255,
+ 'not null' => TRUE,
+ 'default' => '',
+ 'description' => 'The vocabulary machine name.',
+ ),
'description' => array(
'type' => 'text',
'not null' => FALSE,
@@ -345,3 +352,29 @@ function taxonomy_update_7001() {
return $ret;
}
+
+/**
+ * Add vocabulary machine_name column.
+ */
+function taxonomy_update_7002() {
+ $ret = array();
+ $field = array(
+ 'type' => 'varchar',
+ 'length' => 255,
+ 'not null' => TRUE,
+ 'default' => '',
+ 'description' => 'The vocabulary machine name.',
+ );
+
+ db_add_field($ret, 'taxonomy_vocabulary', 'machine_name', $field);
+
+ foreach (taxonomy_get_vocabularies() as $vid => $vocabulary) {
+ $machine_name = 'vocabulary_' . $vid;
+ db_update('taxonomy_vocabulary')
+ ->fields(array('machine_name' => 'vocabulary_' . $vid))
+ ->condition('vid', $vid)
+ ->execute();
+ field_attach_create_bundle($machine_name);
+ }
+ return $ret;
+}