<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20260709212604 extends AbstractMigration
{
public function getDescription(): string
{
return 'Updating promotion table to use new type free_delivery before removing the field free_delivery';
}
public function up(Schema $schema): void
{
$this->addSql("UPDATE promotion SET type = 'free_delivery', value = 0.0 WHERE free_delivery = 1");
}
public function down(Schema $schema): void
{
$this->addSql("UPDATE promotion SET free_delivery = 1, type = 'value', value = 0.0 WHERE type = 'free_delivery'");
}
}