You are here

function acquia_lift_update_7002 in Acquia Lift Connector 7.2

Same name and namespace in other branches
  1. 7 acquia_lift.install \acquia_lift_update_7002()

Fix control rate percentage to not be the inverse percentage.

File

./acquia_lift.install, line 436
Acquia Lift - Installation file.

Code

function acquia_lift_update_7002() {
  $result = db_select('personalize_agent', 'a')
    ->fields('a', array(
    'machine_name',
    'data',
  ))
    ->execute();
  foreach ($result as $row) {
    $data = unserialize($row->data);
    if (isset($data['control_rate'])) {
      $data['control_rate'] = 100 - $data['control_rate'];
    }
    db_update('personalize_agent')
      ->condition('machine_name', $row->machine_name)
      ->fields(array(
      'data' => serialize($data),
    ))
      ->execute();
  }
}