You are here

function notifications_update_1 in Notifications 6.4

Same name and namespace in other branches
  1. 5 notifications.install \notifications_update_1()
  2. 6 notifications.install \notifications_update_1()
  3. 6.2 notifications.install \notifications_update_1()
  4. 6.3 notifications.install \notifications_update_1()

Update: Add cron flag for processing

File

./notifications.install, line 267

Code

function notifications_update_1() {
  $ret = array();

  // Add field
  $ret[] = update_sql("ALTER TABLE {notifications} ADD COLUMN `cron` TINYINT UNSIGNED NOT NULL DEFAULT 0");
  $ret[] = update_sql("ALTER TABLE {notifications_queue} ADD COLUMN `cron` TINYINT UNSIGNED NOT NULL DEFAULT 0");

  // Populate field, this is new so all stored rows till now should be intended for cron processing
  $ret[] = update_sql("UPDATE {notifications} SET cron = 1");
  $ret[] = update_sql("UPDATE {notifications_queue} SET cron = 1");
  return $ret;
}