You are here

function feeds_update_6008 in Feeds 6

Same name and namespace in other branches
  1. 7 feeds.install \feeds_update_6008()

Add batch field to feeds_source table, adjust feeds_schedule table.

File

./feeds.install, line 391
Schema definitions install/update/uninstall hooks.

Code

function feeds_update_6008() {
  $ret = array();
  $spec = array(
    'type' => 'text',
    'size' => 'big',
    'not null' => FALSE,
    'description' => t('Cache for batching.'),
    'serialize' => TRUE,
  );
  db_add_field($ret, 'feeds_source', 'batch', $spec);

  // Make scheduled flag a timestamp.
  $spec = array(
    'type' => 'int',
    'size' => 'normal',
    'unsigned' => TRUE,
    'default' => 0,
    'not null' => TRUE,
    'description' => 'Timestamp when a job was scheduled. 0 if a job is currently not scheduled.',
  );
  db_change_field($ret, 'feeds_schedule', 'scheduled', 'scheduled', $spec);

  // Rename last_scheduled_time to last_executed_time, fix unsigned property.
  $spec = array(
    'type' => 'int',
    'size' => 'normal',
    'unsigned' => TRUE,
    'default' => 0,
    'not null' => TRUE,
    'description' => 'Timestamp when a job was last executed.',
  );
  db_change_field($ret, 'feeds_schedule', 'last_scheduled_time', 'last_executed_time', $spec);
  return $ret;
}