migrations/Version20220922162605.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. /**
  7.  * Auto-generated Migration: Please modify to your needs!
  8.  */
  9. final class Version20220922162605 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         // this up() migration is auto-generated, please modify it to your needs
  18.         $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');
  19.         $this->addSql('ALTER TABLE payment ADD CONSTRAINT FK_6D28840D5AA1164F FOREIGN KEY (payment_method_id) REFERENCES payment_method (id)');
  20.         $this->addSql('CREATE INDEX IDX_6D28840D5AA1164F ON payment (payment_method_id)');
  21.     }
  22.     public function down(Schema $schema): void
  23.     {
  24.         // this down() migration is auto-generated, please modify it to your needs
  25.         $this->addSql('ALTER TABLE payment DROP FOREIGN KEY FK_6D28840D5AA1164F');
  26.         $this->addSql('DROP INDEX IDX_6D28840D5AA1164F ON payment');
  27.         $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');
  28.     }
  29. }