<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20250730044307 extends AbstractMigration
{
public function getDescription(): string
{
return 'Add sync_date field to dtb_order table for API synchronization tracking';
}
public function up(Schema $schema): void
{
$table = $schema->getTable('dtb_order');
if (!$table->hasColumn('sync_date')) {
$this->addSql("ALTER TABLE dtb_order ADD sync_date TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL");
$this->addSql("COMMENT ON COLUMN dtb_order.sync_date IS 'API synchronization date'");
}
}
public function down(Schema $schema): void
{
$table = $schema->getTable('dtb_order');
if ($table->hasColumn('sync_date')) {
$this->addSql("ALTER TABLE dtb_order DROP COLUMN sync_date");
}
}
}