You are here

function multiblock_update_6100 in MultiBlock 6

Upgrade to Drupal 6.

File

./multiblock.install, line 61

Code

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

  // Keys must be dropped before altering the column.
  db_drop_primary_key($ret, 'multiblock');

  // Alter to add primary key with auto-increment.
  db_change_field($ret, 'multiblock', 'delta', 'delta', array(
    'type' => 'serial',
    'not null' => TRUE,
  ), array(
    'primary key' => array(
      'delta',
    ),
  ));

  // Reduce the size of the multi_settings flag column.
  db_change_field($ret, 'multiblock', 'multi_settings', 'multi_settings', array(
    'type' => 'int',
    'size' => 'tiny',
    'unsigned' => TRUE,
    'not null' => TRUE,
    'default' => 0,
  ));
  return $ret;
}