<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20241205205103 extends AbstractMigration
{
public function getDescription(): string
{
return 'Change OrderCoupon relation from ManyToOne to OneToOne';
}
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE order_coupon DROP INDEX IDX_A7302FD78D9F6D38, ADD UNIQUE INDEX UNIQ_A7302FD78D9F6D38 (order_id)');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE order_coupon DROP INDEX UNIQ_A7302FD78D9F6D38, ADD INDEX IDX_A7302FD78D9F6D38 (order_id)');
}
}