<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20240830165948 extends AbstractMigration
{
public function getDescription(): string
{
return 'Add temporary relation column to abap_payment';
}
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE abap_payment ADD application_id UUID DEFAULT NULL');
$this->addSql('COMMENT ON COLUMN abap_payment.application_id IS \'(DC2Type:uuid)\'');
$this->addSql('ALTER TABLE abap_payment ADD CONSTRAINT FK_725EDF733E030ACD FOREIGN KEY (application_id) REFERENCES application (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('CREATE INDEX IDX_725EDF733E030ACD ON abap_payment (application_id)');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE abap_payment DROP CONSTRAINT FK_725EDF733E030ACD');
$this->addSql('DROP INDEX IDX_725EDF733E030ACD');
$this->addSql('ALTER TABLE abap_payment DROP application_id');
}
}