You are here

function units_update_7101 in Units of Measurement 7.2

Same name and namespace in other branches
  1. 7 units.install \units_update_7101()

Implements hook_update_N().

Update to version of Units module, that supports 'symbol' for 'units_unit' entity type.

File

./units.install, line 201
Install and uninstall hooks of the Units module.

Code

function units_update_7101() {

  // Adding 'symbol' column to the 'units_unit' table.
  $table = 'units_unit';
  $column = 'symbol';
  if (!db_field_exists($table, $column)) {
    $schema = drupal_get_schema($table, TRUE);
    db_add_field($table, $column, $schema['fields'][$column]);
  }
  return t('Updated settings of Units module. Now it supports <em>symbol</em> property for units.');
}