You are here

function pay_update_6006 in Pay 7

Same name and namespace in other branches
  1. 6 pay.install \pay_update_6006()

Rename 'activity' to 'action' in pay_method.

File

./pay.install, line 410
Pay module allows for accepting payments against a node using pluggable payment backends.

Code

function pay_update_6006() {
  $res = db_query("SELECT * FROM {pay_method}");
  while ($row = db_fetch_object($res)) {
    $settings = unserialize($row->settings);
    if (array_key_exists('pay_form_activity', $settings)) {
      $settings['pay_form_action'] = $settings['pay_form_activity'];
      unset($settings['pay_form_activity']);
      db_update('pay_method')
        ->fields(array(
        'settings' => serialize($settings),
      ))
        ->condition('pmid', $row->pmid)
        ->execute();
    }
  }
  return t('Renamed "activity" column to "action" in pay_method table.');
}