-
Notifications
You must be signed in to change notification settings - Fork 0
/
cron.install
131 lines (127 loc) · 3.4 KB
/
cron.install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<?php
/**
* @file
* Install, update and uninstall functions for the cron module.
*/
/**
* Implements hook_schema().
*
* @return array mixed
*/
function cron_schema() {
$schema['cron_job'] = array(
'description' => 'The base table for cron jobs.',
'fields' => array(
'id' => array(
'description' => 'The primary identifier for the cron job.',
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
),
'uuid' => array(
'description' => 'Unique Key: Universally unique identifier for this entity.',
'type' => 'varchar',
'length' => 128,
'not null' => FALSE,
),
'name' => array(
'description' => 'The name of the cron job.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'type' => array(
'description' => 'The type of the cron job.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'command' => array(
'description' => 'The command the cron job has to execute.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'schedule' => array(
'description' => 'The schedule when the cron job has to be executed.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'description' => array(
'description' => 'The description of the cron job.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'enabled' => array(
'description' => 'Status of the cron job.',
'type' => 'int',
'size' => 'tiny',
'not null' => TRUE,
'default' => 0,
),
),
'unique keys' => array(
'un_name' => array('name'),
),
'foreign keys' => array(),
'primary key' => array('id'),
);
$schema['cron_report'] = array(
'description' => 'The base table for cron reports.',
'fields' => array(
'id' => array(
'description' => 'The primary identifier for the cron report.',
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
),
'run_at' => array(
'description' => 'Datetime when the cron job was run.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'run_time' => array(
'description' => 'The amount of time the cron job has run.',
'type' => 'float',
'not null' => TRUE,
'default' => 0,
),
'exit_code' => array(
'description' => 'The exit code of the cron job.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'output' => array(
'description' => 'The output of the cron job.',
'type' => 'text',
'not null' => TRUE,
),
'job' => array(
'description' => 'The cron job this report belongs to.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
),
'foreign keys' => array(
'cron_job' => array(
'table' => 'cron_job',
'columns' => array('job' => 'id'),
),
),
'primary key' => array('id'),
);
return $schema;
}