Skip to content

Commit

Permalink
[CronJob] Add notes to CronJob entity
Browse files Browse the repository at this point in the history
  • Loading branch information
mpoiriert committed May 8, 2024
1 parent 9c57209 commit c7c5aef
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
29 changes: 29 additions & 0 deletions app/migrations/Version20240508132341.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

declare(strict_types=1);

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20240508132341 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}

public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE cron_job__cron_job ADD notes LONGTEXT DEFAULT NULL');
}

public function down(Schema $schema): void
{
}
}
15 changes: 15 additions & 0 deletions packages/cron-job/Entity/CronJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ class CronJob implements \Stringable
#[Assert\Range(min: 0, max: 255)]
private ?int $priority = null;

#[ORM\Column(name: 'notes', type: 'text', nullable: true)]
private ?string $notes = null;

/**
* @var Selectable&Collection<CronJobExecution>
*/
Expand Down Expand Up @@ -153,6 +156,18 @@ public function setPriority(?int $priority): self
return $this;
}

public function getNotes(): ?string
{
return $this->notes;
}

public function setNotes(?string $notes): self
{
$this->notes = $notes;

return $this;
}

/**
* @return Selectable&Collection<CronJobExecution>
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ protected function configureFormFields(FormMapper $form): void
$form
->with('Definition', ['class' => 'col-md-8'])
->add('name')
->add('notes')
->add(
'command',
null,
Expand All @@ -79,6 +80,7 @@ protected function configureShowFields(ShowMapper $show): void

$show
->add('name')
->add('notes')
->add('command')
->add('schedule')
->add('active')
Expand Down

0 comments on commit c7c5aef

Please sign in to comment.