<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20251209170000 extends AbstractMigration
{
public function getDescription(): string
{
return 'Adds "Hediye Çeki" to payment_method table';
}
public function up(Schema $schema): void
{
// Check if "Hediye Çeki" already exists to avoid duplicates (though name is not unique constraint usually, good practice)
$exists = $this->connection->fetchOne("SELECT count(*) FROM payment_method WHERE name = 'Hediye Çeki'");
if (!$exists) {
$this->addSql("INSERT INTO payment_method (name, details) VALUES ('Hediye Çeki', 'Gift Voucher Payment')");
}
}
public function down(Schema $schema): void
{
$this->addSql("DELETE FROM payment_method WHERE name = 'Hediye Çeki'");
}
}