28 lines
763 B
PHP
28 lines
763 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
declare(strict_types=1);
|
||
|
|
|
||
|
|
namespace DoctrineMigrations;
|
||
|
|
|
||
|
|
use Doctrine\DBAL\Schema\Schema;
|
||
|
|
use Doctrine\Migrations\AbstractMigration;
|
||
|
|
|
||
|
|
final class Version20260323200000 extends AbstractMigration
|
||
|
|
{
|
||
|
|
public function getDescription(): string
|
||
|
|
{
|
||
|
|
return 'Add refunded_amount column to billet_buyer for partial refund support';
|
||
|
|
}
|
||
|
|
|
||
|
|
public function up(Schema $schema): void
|
||
|
|
{
|
||
|
|
$this->addSql('ALTER TABLE billet_buyer ADD COLUMN IF NOT EXISTS refunded_amount INT DEFAULT 0');
|
||
|
|
$this->addSql('UPDATE billet_buyer SET refunded_amount = 0 WHERE refunded_amount IS NULL');
|
||
|
|
}
|
||
|
|
|
||
|
|
public function down(Schema $schema): void
|
||
|
|
{
|
||
|
|
$this->addSql('ALTER TABLE billet_buyer DROP COLUMN IF EXISTS refunded_amount');
|
||
|
|
}
|
||
|
|
}
|