From 2bc9e50dbaa83df96090172b3fc682bd9a291588 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Fri, 12 Jun 2009 13:59:56 +0000 Subject: - Patch #413192 by catch et al: make taxonomy terms fieldable (not to be confused with taxonomy terms as fields). --- modules/taxonomy/taxonomy.install | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'modules/taxonomy/taxonomy.install') 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; +} -- cgit v1.2.3