You are here

function nodeorder_update_6100 in Node Order 6

Update function for Nodeorder-6.x-1.* Original nodeorder schema used an unsigned field for the weight. With the new ordering from core this should be changed to a signed field. We therefore take the following measures:

  • change the field to a signed field

File

./nodeorder.install, line 106
Nodeorder install file.

Code

function nodeorder_update_6100() {
  $ret = array();

  // Create an index for 'weight_in_tid'
  $keys['indexes'] = array(
    'weight_in_tid' => array(
      'weight_in_tid',
    ),
  );

  // Set field properties
  $spec = array(
    'type' => 'int',
    'signed' => TRUE,
    'not null' => TRUE,
    'default' => 0,
    'initial' => 0,
    'description' => t('A user-defined weight for each node in its respective category.'),
  );

  // change field to a SIGNED int
  db_change_field($ret, 'term_node', 'weight_in_tid', 'weight_in_tid', $spec, $keys);
  return $ret;
}