You are here

function ultimate_cron_schema in Ultimate Cron 6

Same name and namespace in other branches
  1. 8.2 ultimate_cron.install \ultimate_cron_schema()
  2. 8 ultimate_cron.install \ultimate_cron_schema()
  3. 7.2 ultimate_cron.install \ultimate_cron_schema()
  4. 7 ultimate_cron.install \ultimate_cron_schema()

Implementation of hook_schema().

1 call to ultimate_cron_schema()
ultimate_cron_update_6002 in ./ultimate_cron.install
Merge ultimate_cron_function and ultimate_cron_configuration into ultimate_cron

File

./ultimate_cron.install, line 11
Installation file for Ultimate Cron

Code

function ultimate_cron_schema() {
  $schema = array();
  $schema['ultimate_cron'] = array(
    'description' => 'Cron job function list',
    'export' => array(
      'key' => 'name',
      'key name' => 'Function name',
      'primary key' => 'fid',
      'identifier' => 'name',
      'default hook' => 'default_ultimate_cron_function',
      'save callback' => 'ultimate_cron_crud_save',
      'api' => array(
        'owner' => 'ultimate_cron',
        'api' => 'default_ultimate_cron_functions',
        'minimum_version' => 1,
        'current_version' => 1,
      ),
    ),
    'fields' => array(
      'fid' => array(
        'description' => 'Function ID',
        'type' => 'serial',
        'size' => 'normal',
        'not null' => TRUE,
        'no export' => TRUE,
      ),
      'name' => array(
        'description' => 'Function name',
        'type' => 'varchar',
        'length' => 127,
        'not null' => TRUE,
      ),
      'settings' => array(
        'description' => 'Settings',
        'type' => 'text',
        'serialize' => TRUE,
        'not null' => FALSE,
      ),
    ),
    'primary key' => array(
      'fid',
    ),
    'unique keys' => array(
      'uniq_name' => array(
        'name',
      ),
    ),
  );
  $schema['ultimate_cron_log'] = array(
    'description' => 'Logs',
    'fields' => array(
      'lid' => array(
        'description' => 'Log ID',
        'type' => 'serial',
        'size' => 'normal',
        'not null' => TRUE,
      ),
      'name' => array(
        'description' => 'Function name',
        'type' => 'varchar',
        'length' => 127,
        'not null' => TRUE,
      ),
      'start_stamp' => array(
        'description' => 'Timstamp of execution start',
        'type' => 'float',
        'size' => 'big',
        'not null' => TRUE,
        'default' => 0,
      ),
      'end_stamp' => array(
        'description' => 'Timstamp of execution end',
        'type' => 'float',
        'size' => 'big',
        'not null' => TRUE,
        'default' => 0,
      ),
      'service_host' => array(
        'description' => 'Service host',
        'type' => 'varchar',
        'length' => 127,
        'not null' => TRUE,
      ),
      'exec_status' => array(
        'description' => 'Status of the execution',
        'type' => 'int',
        'size' => 'normal',
        'not null' => FALSE,
        'default' => NULL,
      ),
      'severity' => array(
        'description' => 'Log level severity',
        'type' => 'int',
        'size' => 'normal',
        'not null' => TRUE,
        'default' => -1,
      ),
      'msg' => array(
        'description' => 'Message',
        'type' => 'text',
        'not null' => FALSE,
      ),
    ),
    'primary key' => array(
      'lid',
    ),
    'indexes' => array(
      'idx_last' => array(
        'name',
        'start_stamp',
      ),
      'idx_count' => array(
        'name',
        'end_stamp',
      ),
    ),
  );
  return $schema;
}