You are here

function panels_update_5299 in Panels 6.3

Update from 5.x v2

File

./panels.install, line 841

Code

function panels_update_5299() {
  if (!empty($GLOBALS['SKIP_PANELS_UPDATES'])) {
    return array();
  }
  $ret = array();

  // Fetch schema version 1.
  $schema = panels_schema_1();

  // Certain really old versions of Panels had errors that would cause invalid
  // panes to be written. This wipes them so that the conversion won't fail:
  $ret[] = update_sql("DELETE FROM {panels_pane} WHERE pid = 0");

  // update pid and did to be serial
  db_drop_primary_key($ret, 'panels_pane');
  db_change_field($ret, 'panels_pane', 'pid', 'pid', $schema['panels_pane']['fields']['pid'], array(
    'primary key' => array(
      'pid',
    ),
  ));
  db_drop_primary_key($ret, 'panels_display');
  db_change_field($ret, 'panels_display', 'did', 'did', $schema['panels_display']['fields']['did'], array(
    'primary key' => array(
      'did',
    ),
  ));
  drupal_set_message(t('Please note that the Panels upgrade from Drupal 5 to Drupal 6 is far from perfect, especially where Views and CCK are involved. Please check all your panels carefully and compare them against the originals. You may need to do some rework to regain your original functionality.'));
  return $ret;
}