diff --git a/app/migrations/Version20240508132341.php b/app/migrations/Version20240508132341.php new file mode 100644 index 00000000..fbb09922 --- /dev/null +++ b/app/migrations/Version20240508132341.php @@ -0,0 +1,29 @@ +addSql('ALTER TABLE cron_job__cron_job ADD notes LONGTEXT DEFAULT NULL'); + } + + public function down(Schema $schema): void + { + } +} diff --git a/packages/cron-job/Entity/CronJob.php b/packages/cron-job/Entity/CronJob.php index c795b7c9..3b0a27fe 100644 --- a/packages/cron-job/Entity/CronJob.php +++ b/packages/cron-job/Entity/CronJob.php @@ -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 */ @@ -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 */ diff --git a/packages/sonata-integration-bundle/CronJob/Admin/CronJobAdmin.php b/packages/sonata-integration-bundle/CronJob/Admin/CronJobAdmin.php index c68fac7a..fc116709 100644 --- a/packages/sonata-integration-bundle/CronJob/Admin/CronJobAdmin.php +++ b/packages/sonata-integration-bundle/CronJob/Admin/CronJobAdmin.php @@ -56,6 +56,7 @@ protected function configureFormFields(FormMapper $form): void $form ->with('Definition', ['class' => 'col-md-8']) ->add('name') + ->add('notes') ->add( 'command', null, @@ -79,6 +80,7 @@ protected function configureShowFields(ShowMapper $show): void $show ->add('name') + ->add('notes') ->add('command') ->add('schedule') ->add('active')