1 taxonomy.install taxonomy_update_1002()

Drop the old taxonomy vocabulary table.

Related topics

File

core/modules/taxonomy/taxonomy.install, line 281
Install, update and uninstall functions for the taxonomy module.

Code

function taxonomy_update_1002() {
  if (db_table_exists('taxonomy_vocabulary')) {
    db_drop_table('taxonomy_vocabulary');
  }
  if (db_table_exists('taxonomy_term_data')) {
    db_query("ALTER TABLE {taxonomy_term_data} ENGINE = InnoDB");
  }
  if (db_field_exists('taxonomy_term_data', 'vid')) {
    db_drop_field('taxonomy_term_data', 'vid');
  }

  // Drop the old indexes and create new ones.
  if (db_index_exists('taxonomy_term_data', 'taxonomy_tree')) {
    db_drop_index('taxonomy_term_data', 'taxonomy_tree');
    db_add_index('taxonomy_term_data', 'taxonomy_tree', array('vocabulary', 'weight', 'name'));
  }
  if (db_index_exists('taxonomy_term_data', 'vid_name')) {
    db_drop_index('taxonomy_term_data', 'vid_name');
  }
  if (!db_index_exists('taxonomy_term_data', 'vocabulary_name')) {
    db_add_index('taxonomy_term_data', 'vocabulary_name', array('vocabulary', 'name'));
  }
}