Skip to content

Commit f54f3a4

Browse files
committed
feat: create SchedulerStore migration with job attributes and comments
1 parent a330dae commit f54f3a4

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

Diff for: config/Migrations/20241206202437_CreateSchedulerStore.php

+9-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
declare(strict_types=1);
33

44
use Migrations\AbstractMigration;
5-
use Phinx\Db\Action\AddColumn;
65

76
class CreateSchedulerStore extends AbstractMigration
87
{
@@ -11,6 +10,7 @@ class CreateSchedulerStore extends AbstractMigration
1110
*
1211
* More information on this method is available here:
1312
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
13+
*
1414
* @return void
1515
*/
1616
public function change(): void
@@ -20,34 +20,41 @@ public function change(): void
2020
'default' => null,
2121
'limit' => 255,
2222
'null' => false,
23+
'comment' => 'Name of the job',
2324
]);
2425
$table->addColumn('interval_job', 'string', [
2526
'default' => null,
2627
'limit' => 255,
2728
'null' => false,
29+
'comment' => 'Interval of the job',
2830
]);
2931
$table->addColumn('task', 'string', [
3032
'default' => null,
3133
'limit' => 255,
3234
'null' => false,
35+
'comment' => 'Task to run, src/Job/Service/*',
3336
]);
3437
$table->addColumn('pass', 'string', [
3538
'default' => null,
3639
'limit' => 255,
37-
'null' => false,
40+
'null' => true,
41+
'comment' => 'Parameters to pass to the task',
3842
]);
3943
$table->addColumn('lastRun', 'datetime', [
4044
'default' => null,
4145
'null' => false,
46+
'comment' => 'Last time the job was run',
4247
]);
4348
$table->addColumn('lastResult', 'integer', [
4449
'default' => 0,
4550
'limit' => 1,
4651
'null' => false,
52+
'comment' => 'Last result of the job, 0 = success, 1 = failure',
4753
]);
4854
$table->AddColumn('paused', 'boolean', [
4955
'default' => false,
5056
'null' => false,
57+
'comment' => 'Is the job paused',
5158
]);
5259
$table->create();
5360
}

0 commit comments

Comments
 (0)