You are here

function scheduler_update_2 in Scheduler 5

Same name and namespace in other branches
  1. 6 scheduler.install \scheduler_update_2()

File

./scheduler.install, line 35

Code

function scheduler_update_2() {
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      $ret[] = update_sql("ALTER TABLE {scheduler} CHANGE timestamp_posted publish_on int(11) NOT NULL default '0'");
      $ret[] = update_sql("ALTER TABLE {scheduler} CHANGE timestamp_hidden unpublish_on int(11) NOT NULL default '0'");
      $ret[] = update_sql("ALTER TABLE {scheduler} ADD timezone int(6) NOT NULL default '0'");
      break;
    case 'pgsql':
      db_change_column($ret, 'scheduler', 'timestamp_posted', 'publish_on', 'integer', array(
        'not null' => TRUE,
        'default' => "0",
      ));
      db_change_column($ret, 'scheduler', 'timestamp_hidden', 'unpublish_on', 'integer', array(
        'not null' => TRUE,
        'default' => "0",
      ));
      db_add_column($ret, 'scheduler', 'timezone', 'integer', array(
        'not null' => TRUE,
        'default' => "0",
      ));
      break;
  }
  return $ret;
}