fix after upgrade script

This commit is contained in:
Yuri Kuznetsov
2024-11-18 11:16:16 +02:00
parent d061e801dc
commit c7b33c2c36

View File

@@ -29,6 +29,7 @@
namespace Espo\Core\Upgrades\Migrations\V9_0;
use Espo\Core\ORM\Repository\Option\SaveOption;
use Espo\Core\Upgrades\Migration\Script;
use Espo\Core\Utils\Metadata;
use Espo\Entities\Preferences;
@@ -54,12 +55,21 @@ class AfterUpgrade implements Script
private function createScheduledJob(): void
{
$found = $this->entityManager
->getRDBRepositoryByClass(ScheduledJob::class)
->where(['job' => 'SendScheduledEmails'])
->findOne();
if ($found) {
return;
}
$this->entityManager->createEntity(ScheduledJob::ENTITY_TYPE, [
'name' => 'Send Scheduled Emails',
'job' => 'SendScheduledEmails',
'status' => 'Active',
'scheduling' => '*/10 * * * *',
]);
], [SaveOption::SKIP_ALL => true]);
}
private function setReactionNotifications(): void
@@ -108,8 +118,6 @@ class AfterUpgrade implements Script
->getEntity($entityType)
->getRelationList();
echo $entityType;
$contactLink = null;
$accountLink = null;