migrations/Version20240220144622.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 Version20240220144622 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return 'Viva-Wallet changes';
  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('DROP TABLE payment_processor_definitions');
  19.         $this->addSql('ALTER TABLE clients ADD parent_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', CHANGE webhook_url webhook_url VARCHAR(255) DEFAULT NULL');
  20.         $this->addSql('ALTER TABLE clients ADD CONSTRAINT FK_C82E74727ACA70 FOREIGN KEY (parent_id) REFERENCES clients (id) ON DELETE SET NULL');
  21.         $this->addSql('CREATE INDEX IDX_C82E74727ACA70 ON clients (parent_id)');
  22.         $this->addSql('ALTER TABLE payment_cards ADD initial_transaction_id VARCHAR(36) DEFAULT NULL');
  23.         $this->addSql('ALTER TABLE processor_credentials ADD client_id VARCHAR(255) DEFAULT NULL, ADD client_secret VARCHAR(255) DEFAULT NULL, ADD accounts_url VARCHAR(255) DEFAULT NULL, ADD smart_checkout_url VARCHAR(255) DEFAULT NULL, ADD source_code VARCHAR(255) DEFAULT NULL, ADD color VARCHAR(10) DEFAULT NULL');
  24.     }
  25.     public function down(Schema $schema): void
  26.     {
  27.         // this down() migration is auto-generated, please modify it to your needs
  28.         $this->addSql('CREATE TABLE payment_processor_definitions (id CHAR(36) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci` COMMENT \'(DC2Type:uuid)\', code VARCHAR(50) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, created_at DATETIME DEFAULT CURRENT_TIMESTAMP, name VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, UNIQUE INDEX UNIQ_C6B6650A77153098 (code), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
  29.         $this->addSql('ALTER TABLE clients DROP FOREIGN KEY FK_C82E74727ACA70');
  30.         $this->addSql('DROP INDEX IDX_C82E74727ACA70 ON clients');
  31.         $this->addSql('ALTER TABLE clients DROP parent_id, CHANGE webhook_url webhook_url VARCHAR(255) NOT NULL');
  32.         $this->addSql('ALTER TABLE payment_cards DROP initial_transaction_id');
  33.         $this->addSql('ALTER TABLE processor_credentials DROP client_id, DROP client_secret, DROP accounts_url, DROP smart_checkout_url, DROP source_code, DROP color');
  34.     }
  35. }