function job_scheduler_schema in Job Scheduler 7.2
Same name and namespace in other branches
- 8.2 job_scheduler.install \job_scheduler_schema()
- 6 job_scheduler.install \job_scheduler_schema()
- 7 job_scheduler.install \job_scheduler_schema()
Implements hook_schema().
File
- ./
job_scheduler.install, line 23 - Schema definitions install/update/uninstall hooks.
Code
function job_scheduler_schema() {
$schema = array();
$schema['job_schedule'] = array(
'description' => 'Schedule of jobs to be executed.',
'fields' => array(
'item_id' => array(
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
'description' => 'Primary Key: Unique item ID.',
),
'name' => array(
'type' => 'varchar',
'length' => 128,
'not null' => TRUE,
'default' => '',
'description' => 'Name of the schedule.',
),
'type' => array(
'type' => 'varchar',
'length' => 128,
'not null' => TRUE,
'default' => '',
'description' => 'Type identifier of the job.',
),
'id' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'unsigned' => TRUE,
'description' => 'Numeric identifier of the job.',
),
'period' => array(
'type' => 'int',
'unsigned' => TRUE,
'default' => 0,
'not null' => TRUE,
'description' => 'Time period after which job is to be executed.',
),
'crontab' => array(
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
'description' => 'Crontab line in *NIX format.',
),
'data' => array(
'type' => 'blob',
'not null' => FALSE,
'size' => 'big',
'serialize' => TRUE,
'description' => 'The arbitrary data for the item.',
),
'expire' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'description' => 'Timestamp when job expires.',
),
'last' => array(
'type' => 'int',
'unsigned' => TRUE,
'default' => 0,
'not null' => TRUE,
'description' => 'Timestamp when a job was last executed.',
),
'periodic' => array(
'type' => 'int',
'size' => 'small',
'unsigned' => TRUE,
'default' => 0,
'not null' => TRUE,
'description' => 'If true job will be automatically rescheduled.',
),
'next' => array(
'type' => 'int',
'unsigned' => TRUE,
'default' => 0,
'not null' => TRUE,
'description' => 'Timestamp when a job is to be executed (next = last + period), used for fast ordering.',
),
'scheduled' => array(
'type' => 'int',
'unsigned' => TRUE,
'default' => 0,
'not null' => TRUE,
'description' => 'Timestamp when a job was scheduled. 0 if a job is currently not scheduled.',
),
),
'primary key' => array(
'item_id',
),
'indexes' => array(
'name_type_id' => array(
'name',
'type',
'id',
),
'name_type' => array(
'name',
'type',
),
'next' => array(
'next',
),
'scheduled' => array(
'scheduled',
),
),
);
return $schema;
}