2
2
declare (strict_types=1 );
3
3
4
4
use Migrations \AbstractMigration ;
5
- use Phinx \Db \Action \AddColumn ;
6
5
7
6
class CreateSchedulerStore extends AbstractMigration
8
7
{
@@ -11,6 +10,7 @@ class CreateSchedulerStore extends AbstractMigration
11
10
*
12
11
* More information on this method is available here:
13
12
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
13
+ *
14
14
* @return void
15
15
*/
16
16
public function change (): void
@@ -20,34 +20,41 @@ public function change(): void
20
20
'default ' => null ,
21
21
'limit ' => 255 ,
22
22
'null ' => false ,
23
+ 'comment ' => 'Name of the job ' ,
23
24
]);
24
25
$ table ->addColumn ('interval_job ' , 'string ' , [
25
26
'default ' => null ,
26
27
'limit ' => 255 ,
27
28
'null ' => false ,
29
+ 'comment ' => 'Interval of the job ' ,
28
30
]);
29
31
$ table ->addColumn ('task ' , 'string ' , [
30
32
'default ' => null ,
31
33
'limit ' => 255 ,
32
34
'null ' => false ,
35
+ 'comment ' => 'Task to run, src/Job/Service/* ' ,
33
36
]);
34
37
$ table ->addColumn ('pass ' , 'string ' , [
35
38
'default ' => null ,
36
39
'limit ' => 255 ,
37
- 'null ' => false ,
40
+ 'null ' => true ,
41
+ 'comment ' => 'Parameters to pass to the task ' ,
38
42
]);
39
43
$ table ->addColumn ('lastRun ' , 'datetime ' , [
40
44
'default ' => null ,
41
45
'null ' => false ,
46
+ 'comment ' => 'Last time the job was run ' ,
42
47
]);
43
48
$ table ->addColumn ('lastResult ' , 'integer ' , [
44
49
'default ' => 0 ,
45
50
'limit ' => 1 ,
46
51
'null ' => false ,
52
+ 'comment ' => 'Last result of the job, 0 = success, 1 = failure ' ,
47
53
]);
48
54
$ table ->AddColumn ('paused ' , 'boolean ' , [
49
55
'default ' => false ,
50
56
'null ' => false ,
57
+ 'comment ' => 'Is the job paused ' ,
51
58
]);
52
59
$ table ->create ();
53
60
}
0 commit comments