Migrate base64 template images data to new column
[MAILPOET-2686]
This commit is contained in:
committed by
Veljko V
parent
bd222a4c32
commit
f5e4bab40b
@@ -12,6 +12,7 @@ use MailPoet\Cron\Workers\SubscribersLastEngagement;
|
||||
use MailPoet\Cron\Workers\UnsubscribeTokens;
|
||||
use MailPoet\Entities\FormEntity;
|
||||
use MailPoet\Entities\NewsletterEntity;
|
||||
use MailPoet\Entities\NewsletterTemplateEntity;
|
||||
use MailPoet\Entities\ScheduledTaskEntity;
|
||||
use MailPoet\Entities\SendingQueueEntity;
|
||||
use MailPoet\Entities\StatisticsFormEntity;
|
||||
@@ -184,6 +185,7 @@ class Populator {
|
||||
$this->addPlacementStatusToForms();
|
||||
$this->migrateFormPlacement();
|
||||
$this->scheduleSubscriberLastEngagementDetection();
|
||||
$this->moveNewsletterTemplatesThumbnailData();
|
||||
}
|
||||
|
||||
private function createMailPoetPage() {
|
||||
@@ -899,4 +901,16 @@ class Populator {
|
||||
Carbon::createFromTimestamp($this->wp->currentTime('timestamp'))
|
||||
);
|
||||
}
|
||||
|
||||
private function moveNewsletterTemplatesThumbnailData() {
|
||||
if (version_compare($this->settings->get('db_version', '3.71.4'), '3.71.3', '>')) {
|
||||
return;
|
||||
}
|
||||
$newsletterTemplatesTable = $this->entityManager->getClassMetadata(NewsletterTemplateEntity::class)->getTableName();
|
||||
$this->entityManager->getConnection()->executeQuery("
|
||||
UPDATE " . $newsletterTemplatesTable . "
|
||||
SET thumbnail_data = thumbnail, thumbnail = NULL
|
||||
WHERE thumbnail LIKE 'data:image%';"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user