oont-contents/plugins/mailpoet/lib/Migrations/Db/Migration_20240617_122847_Db.php
2025-02-08 15:10:23 +01:00

24 lines
622 B
PHP

<?php declare(strict_types = 1);
namespace MailPoet\Migrations\Db;
if (!defined('ABSPATH')) exit;
use MailPoet\Entities\ScheduledTaskEntity;
use MailPoet\Migrator\DbMigration;
class Migration_20240617_122847_Db extends DbMigration {
public function run(): void {
$scheduledTasksTable = $this->getTableName(ScheduledTaskEntity::class);
$newColumn = 'cancelled_at';
if ($this->columnExists($scheduledTasksTable, $newColumn)) {
return;
}
$this->connection->executeQuery(
"ALTER TABLE `{$scheduledTasksTable}`
ADD COLUMN `{$newColumn}` TIMESTAMP NULL DEFAULT NULL"
);
}
}