| 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 |
| 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 |
|
|