migrations/Version20220513171628.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 Version20220513171628 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 transfer ADD CONSTRAINT FK_4034A3C0712520F3 FOREIGN KEY (wallet_id) REFERENCES wallet (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
  19.         $this->addSql('ALTER TABLE transfer ADD CONSTRAINT FK_4034A3C03ECC0C32 FOREIGN KEY (beneficiary_wallet_id) REFERENCES wallet (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
  20.         $this->addSql('CREATE INDEX IDX_4034A3C0712520F3 ON transfer (wallet_id)');
  21.         $this->addSql('CREATE INDEX IDX_4034A3C03ECC0C32 ON transfer (beneficiary_wallet_id)');
  22.         $this->addSql('CREATE INDEX IDX_TRANSFER_TRANSFERID ON transfer (transfer_id)');
  23.         $this->addSql('ALTER TABLE transfer DROP CONSTRAINT fk_4034a3c071c5ad17');
  24.         $this->addSql('DROP INDEX idx_4034a3c071c5ad17');
  25.         $this->addSql('ALTER TABLE transfer DROP user_wallet_id');
  26.     }
  27.     public function down(Schema $schema): void
  28.     {
  29.         // this down() migration is auto-generated, please modify it to your needs
  30.         $this->addSql('CREATE SCHEMA public');
  31.         $this->addSql('ALTER TABLE transfer DROP CONSTRAINT FK_4034A3C0712520F3');
  32.         $this->addSql('ALTER TABLE transfer DROP CONSTRAINT FK_4034A3C03ECC0C32');
  33.         $this->addSql('DROP INDEX IDX_4034A3C0712520F3');
  34.         $this->addSql('DROP INDEX IDX_4034A3C03ECC0C32');
  35.         $this->addSql('DROP INDEX IDX_TRANSFER_TRANSFERID');
  36.         $this->addSql('ALTER TABLE transfer ADD user_wallet_id INT NOT NULL');
  37.         $this->addSql('ALTER TABLE transfer ADD CONSTRAINT fk_4034a3c071c5ad17 FOREIGN KEY (user_wallet_id) REFERENCES wallet (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
  38.         $this->addSql('CREATE INDEX idx_4034a3c071c5ad17 ON transfer (user_wallet_id)');
  39.     }
  40. }