<?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 Version20220922162605 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('ALTER TABLE payment ADD payment_method_id INT NOT NULL, ADD state VARCHAR(255) NOT NULL, ADD external_id VARCHAR(255) DEFAULT NULL, ADD currency VARCHAR(255) NOT NULL, ADD client_secret VARCHAR(255) DEFAULT NULL, ADD details LONGTEXT DEFAULT NULL, ADD amount INT DEFAULT NULL, ADD canceled_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', DROP reference_number, DROP payment_amount, DROP payment_due_date, DROP status, DROP collected_data, DROP is_deposited, DROP is_refundable');
$this->addSql('ALTER TABLE payment ADD CONSTRAINT FK_6D28840D5AA1164F FOREIGN KEY (payment_method_id) REFERENCES payment_method (id)');
$this->addSql('CREATE INDEX IDX_6D28840D5AA1164F ON payment (payment_method_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE payment DROP FOREIGN KEY FK_6D28840D5AA1164F');
$this->addSql('DROP INDEX IDX_6D28840D5AA1164F ON payment');
$this->addSql('ALTER TABLE payment ADD reference_number VARCHAR(255) NOT NULL, ADD payment_amount DOUBLE PRECISION NOT NULL, ADD payment_due_date DATETIME NOT NULL, ADD status VARCHAR(255) NOT NULL, ADD collected_data LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', ADD is_deposited TINYINT(1) NOT NULL, ADD is_refundable TINYINT(1) NOT NULL, DROP payment_method_id, DROP state, DROP external_id, DROP currency, DROP client_secret, DROP details, DROP amount, DROP canceled_at');
}
}