<?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 Version20240402134800 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE payment_transactions (id INT AUTO_INCREMENT NOT NULL, payment_id INT NOT NULL, type VARCHAR(50) DEFAULT NULL, date DATETIME NOT NULL, status SMALLINT NOT NULL, message VARCHAR(255) DEFAULT NULL, xml_request LONGTEXT DEFAULT NULL, xml_response LONGTEXT DEFAULT NULL, ip VARCHAR(255) NOT NULL, deleted_at DATETIME DEFAULT NULL, INDEX IDX_8C58AD564C3A3BB (payment_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE payment_transactions ADD CONSTRAINT FK_8C58AD564C3A3BB FOREIGN KEY (payment_id) REFERENCES payment (id) ON DELETE CASCADE');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE payment_transactions DROP FOREIGN KEY FK_8C58AD564C3A3BB');
$this->addSql('DROP TABLE payment_transactions');
}
}