You are here

function uc_file_update_6001 in Ubercart 6.2

File

uc_file/uc_file.install, line 245
Install, update and uninstall functions for the uc_file module.

Code

function uc_file_update_6001() {
  $ret = array();
  $new_field = array(
    'type' => 'varchar',
    'length' => 32,
    'not null' => TRUE,
    'default' => '',
  );

  // change the key field to something less conflicting...
  if (db_column_exists('uc_file_users', 'key')) {

    // workaround for Drupal limitation
    if ($GLOBALS['db_type'] == 'mysql' || $GLOBALS['db_type'] == 'mysqli') {
      $field = '`key`';
    }
    else {
      $field = 'key';
    }
    db_change_field($ret, 'uc_file_users', $field, 'file_key', $new_field);
  }
  return $ret;
}