You are here

function coder_upgrade_upgrade_database_tables in Coder 7.2

Same name and namespace in other branches
  1. 7 coder_upgrade/conversions/regex.inc \coder_upgrade_upgrade_database_tables()

Upgrades database tables.

1 call to coder_upgrade_upgrade_database_tables()
coder_upgrade_upgrade_regex_alter in coder_upgrade/conversions/regex.inc
Implements hook_upgrade_regex_alter().

File

coder_upgrade/conversions/regex.inc, line 134
Miscellaneous conversion routine file for the coder_upgrade module. These routines upgrade text using simple regular expressions.

Code

function coder_upgrade_upgrade_database_tables(&$from, &$to) {
  $table_conversion = array(
    'box' => 'custom_block',
    // TODO Is this an error?
    'boxes' => 'block_custom',
    'blocks' => 'block',
    'blocks_roles' => 'block_role',
  );
  foreach ($table_conversion as $old_table => $new_table) {
    $from[] = '/\\{' . $old_table . '\\}/i';
    $to[] = '{' . $new_table . '}';
  }

  // http://drupal.org/node/224333#taxonomy_tables
  // This expression format is more compact than above.
  $from[] = '@({|\'|")(term_data|term_hierarchy|term_node|term_relation|term_synonym|vocabulary)(}|\'|")@';
  $to[] = "\$1taxonomy_\$2\$3";
  $from[] = '@({|\'|")(vocabulary_node_type)s(}|\'|")@';
  $to[] = "\$1taxonomy_\$2\$3";
}