<?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 Version20240220144622 extends AbstractMigration
{
public function getDescription(): string
{
return 'Viva-Wallet changes';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE payment_processor_definitions');
$this->addSql('ALTER TABLE clients ADD parent_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', CHANGE webhook_url webhook_url VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE clients ADD CONSTRAINT FK_C82E74727ACA70 FOREIGN KEY (parent_id) REFERENCES clients (id) ON DELETE SET NULL');
$this->addSql('CREATE INDEX IDX_C82E74727ACA70 ON clients (parent_id)');
$this->addSql('ALTER TABLE payment_cards ADD initial_transaction_id VARCHAR(36) DEFAULT NULL');
$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');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$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 = \'\' ');
$this->addSql('ALTER TABLE clients DROP FOREIGN KEY FK_C82E74727ACA70');
$this->addSql('DROP INDEX IDX_C82E74727ACA70 ON clients');
$this->addSql('ALTER TABLE clients DROP parent_id, CHANGE webhook_url webhook_url VARCHAR(255) NOT NULL');
$this->addSql('ALTER TABLE payment_cards DROP initial_transaction_id');
$this->addSql('ALTER TABLE processor_credentials DROP client_id, DROP client_secret, DROP accounts_url, DROP smart_checkout_url, DROP source_code, DROP color');
}
}