<?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 Version20220513171628 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 transfer ADD CONSTRAINT FK_4034A3C0712520F3 FOREIGN KEY (wallet_id) REFERENCES wallet (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE transfer ADD CONSTRAINT FK_4034A3C03ECC0C32 FOREIGN KEY (beneficiary_wallet_id) REFERENCES wallet (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('CREATE INDEX IDX_4034A3C0712520F3 ON transfer (wallet_id)');
$this->addSql('CREATE INDEX IDX_4034A3C03ECC0C32 ON transfer (beneficiary_wallet_id)');
$this->addSql('CREATE INDEX IDX_TRANSFER_TRANSFERID ON transfer (transfer_id)');
$this->addSql('ALTER TABLE transfer DROP CONSTRAINT fk_4034a3c071c5ad17');
$this->addSql('DROP INDEX idx_4034a3c071c5ad17');
$this->addSql('ALTER TABLE transfer DROP user_wallet_id');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE SCHEMA public');
$this->addSql('ALTER TABLE transfer DROP CONSTRAINT FK_4034A3C0712520F3');
$this->addSql('ALTER TABLE transfer DROP CONSTRAINT FK_4034A3C03ECC0C32');
$this->addSql('DROP INDEX IDX_4034A3C0712520F3');
$this->addSql('DROP INDEX IDX_4034A3C03ECC0C32');
$this->addSql('DROP INDEX IDX_TRANSFER_TRANSFERID');
$this->addSql('ALTER TABLE transfer ADD user_wallet_id INT NOT NULL');
$this->addSql('ALTER TABLE transfer ADD CONSTRAINT fk_4034a3c071c5ad17 FOREIGN KEY (user_wallet_id) REFERENCES wallet (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('CREATE INDEX idx_4034a3c071c5ad17 ON transfer (user_wallet_id)');
}
}