You are here

function ultimate_cron_update_7101 in Ultimate Cron 7

Same name and namespace in other branches
  1. 7.2 ultimate_cron.install \ultimate_cron_update_7101()

Move messages to log table.

File

./ultimate_cron.install, line 193
Installation file for Ultimate Cron

Code

function ultimate_cron_update_7101() {
  if (!db_field_exists('ultimate_cron_log', 'msg')) {

    // 'msg' doesn't exist, so this update has never run and was never run when
    // it was previously called ultimate_cron_update_6000() or
    // ultimate_cron_update_7000() - hence, it needs to be run.
    db_add_field('ultimate_cron_log', 'msg', array(
      'description' => 'Message',
      'type' => 'text',
      'not null' => FALSE,
    ));
    db_query("UPDATE {ultimate_cron_log} l JOIN {ultimate_cron_log_message} m ON l.lid = m.lid SET l.msg = m.msg");
    db_drop_table('ultimate_cron_log_message');
  }
}