function tripal_core_jobs_schema

1.x tripal_core.install tripal_core_jobs_schema()

Describes the Tripal Jobs (tripal_jobs) table This table keeps track of all tripal jobs including their current status and is used by tripal_launch_jobs to determine which jobs need to be run

Related topics

1 call to tripal_core_jobs_schema()
tripal_core_get_schemas in tripal_core/tripal_core.install
This function simply defines all tables needed for the module to work correctly. By putting the table definitions in a separate function we can easily provide the entire list for hook_install or individual tables for an update.

File

tripal_core/tripal_core.install, line 168
Contains functions used to install/uninstall tripal_core.

Code

function tripal_core_jobs_schema() {
  $schema = array();
  $schema['tripal_jobs'] = array(
    'fields' => array(
      'job_id' => array('type' => 'serial', 'unsigned' => TRUE, 'not NULL' => TRUE),
      'uid' => array('type' => 'int', 'unsigned' => TRUE, 'not NULL' => TRUE, 'description' => 'The Drupal userid of the submitee'),
      'job_name' => array('type' => 'varchar', 'length' => 255, 'not NULL' => TRUE),
      'modulename' => array('type' => 'varchar', 'length' => 50, 'not NULL' => TRUE, 'description' => 'The module name that provides the callback for this job'),
      'callback' => array('type' => 'varchar', 'length' => 255, 'not NULL' => TRUE),
      'arguments' => array('type' => 'text', 'size' => 'normal', 'not NULL' => FALSE),
      'progress' => array('type' => 'int', 'unsigned' => TRUE, 'default' => 0, 'not NULL' => FALSE, 'description' => 'a value from 0 to 100 indicating percent complete'),
      'status' => array('type' => 'varchar', 'length' => 50, 'not NULL' => TRUE),
      'submit_date' => array('type' => 'int', 'not NULL' => TRUE, 'description' => 'UNIX integer submit time'),
      'start_time' => array('type' => 'int', 'not NULL' => FALSE, 'description' => 'UNIX integer start time'),
      'end_time' => array('type' => 'int', 'not NULL' => FALSE, 'description' => 'UNIX integer end time'),
      'error_msg' => array('type' => 'text', 'size' => 'normal', 'not NULL' => FALSE),
      'pid' => array('type' => 'int', 'unsigned' => TRUE, 'not NULL' => FALSE, 'description' => 'The process id for the job'),
      'priority' => array('type' => 'int', 'unsigned' => TRUE, 'not NULL' => TRUE, 'default' => '0', 'description' => 'The job priority'),
      'mlock' => array('type' => 'int', 'unsigned' => TRUE, 'not NULL' => FALSE, 'description' => 'If set to 1 then all jobs for the module are held until this one finishes'),
      'lock' => array('type' => 'int', 'unsigned' => TRUE, 'not NULL' => FALSE, 'description' => 'If set to 1 then all jobs are held until this one finishes'),
    ),
    'indexes' => array(
      'job_id' => array('job_id'),
      'job_name' => array('job_name')
    ),
    'primary key' => array('job_id'),
  );

  return $schema;
}