/[drupal]/contributions/modules/mlm/mlm.install
ViewVC logotype

Diff of /contributions/modules/mlm/mlm.install

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.13, Sun Aug 23 23:06:27 2009 UTC revision 1.14, Sat Oct 31 01:31:14 2009 UTC
# Line 1  Line 1 
1  <?php // $Id: mlm.install,v 1.12 2009/02/22 18:39:45 vauxia Exp $  <?php // $Id: mlm.install,v 1.13 2009/08/23 23:06:27 vauxia Exp $
2    
3  /**  /**
4   * @file   * @file
# Line 282  function mlm_update_5() { Line 282  function mlm_update_5() {
282  // Change the 'post' table id column to serial for each ezmlm_idx table.  // Change the 'post' table id column to serial for each ezmlm_idx table.
283  function mlm_update_6001() {  function mlm_update_6001() {
284    $ret = array();    $ret = array();
285    foreach (mlm_lists() as $list) {    if (module_exists('mlm')) {
286      if ($troot = $list->mlm_ezmlm_idx->troot) {      foreach (mlm_lists() as $list) {
287        $table = $troot .'_post';        if ($troot = $list->mlm_ezmlm_idx->troot) {
288            $table = $troot .'_post';
289        db_set_active($list->mlm_ezmlm_idx->dsn);  
290            db_set_active($list->mlm_ezmlm_idx->dsn);
291        db_drop_primary_key($ret, $table);  
292        db_change_field($ret, $table, 'id', 'id', array('type' => 'serial', 'not null' => TRUE), array('primary key' => array('id')));          db_drop_primary_key($ret, $table);
293            db_change_field($ret, $table, 'id', 'id', array('type' => 'serial', 'not null' => TRUE), array('primary key' => array('id')));
294        db_set_active();  
295            db_set_active();
296          }
297      }      }
298    }    }
299      else {
300        // don't attempt to upgrade if send is not enabled.
301        drupal_set_message(t('MLM module must be enabled for updates to complete. After enabling MLM, please return to <a href="@update-php">update.php</a> and
302    run the remaining updates.', array('@update-php' => base_path() .'update.php?op=selection')), 'warning', FALSE);
303    
304        $ret['#abort'] = array(
305          'success' => FALSE,
306          'query' => t('MLM updates require that the MLM module be enabled. After enabling MLM re-run update.php.'),
307        );
308      }
309    return $ret;    return $ret;
310  }  }
311    

Legend:
Removed from v.1.13  
changed lines
  Added in v.1.14

  ViewVC Help
Powered by ViewVC 1.1.2