<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20240927165408 extends AbstractMigration
{
public function getDescription(): string
{
return 'Fix wrong type for completed_payment_id in shipment';
}
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE shipment DROP CONSTRAINT FK_2CB20DCFF21A60C');
$this->addSql('ALTER TABLE shipment ADD CONSTRAINT FK_2CB20DCFF21A60C FOREIGN KEY (completed_payment_id) REFERENCES abap_payment (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
}
public function down(Schema $schema): void
{
$this->addSql('CREATE SCHEMA public');
$this->addSql('ALTER TABLE shipment DROP CONSTRAINT fk_2cb20dcff21a60c');
$this->addSql('ALTER TABLE shipment ADD CONSTRAINT fk_2cb20dcff21a60c FOREIGN KEY (completed_payment_id) REFERENCES shipment (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
}
}