migrations/Version20230316145425.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 Version20230316145425 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 currency CHANGE value value NUMERIC(10, 6) NOT NULL');
  19.         $this->addSql('ALTER TABLE task DROP FOREIGN KEY FK_527EDB2553C674EE');
  20.         $this->addSql('DROP INDEX IDX_527EDB2553C674EE ON task');
  21.         $this->addSql('ALTER TABLE task DROP FOREIGN KEY FK_527EDB2538248176');
  22.         $this->addSql('ALTER TABLE task DROP offer_id');
  23.         $this->addSql('ALTER TABLE task ADD CONSTRAINT FK_527EDB25DAADA679 FOREIGN KEY (task_type_id) REFERENCES task_type (id)');
  24.         $this->addSql('CREATE INDEX IDX_527EDB25DAADA679 ON task (task_type_id)');
  25.         $this->addSql('DROP INDEX fk_527edb2538248176 ON task');
  26.         $this->addSql('CREATE INDEX IDX_527EDB2538248176 ON task (currency_id)');
  27.         $this->addSql('ALTER TABLE task ADD CONSTRAINT FK_527EDB2538248176 FOREIGN KEY (currency_id) REFERENCES currency (id)');
  28.     }
  29.     public function down(Schema $schema): void
  30.     {
  31.         // this down() migration is auto-generated, please modify it to your needs
  32.         $this->addSql('ALTER TABLE currency CHANGE value value NUMERIC(10, 0) NOT NULL');
  33.         $this->addSql('ALTER TABLE task DROP FOREIGN KEY FK_527EDB25DAADA679');
  34.         $this->addSql('DROP INDEX IDX_527EDB25DAADA679 ON task');
  35.         $this->addSql('ALTER TABLE task DROP FOREIGN KEY FK_527EDB2538248176');
  36.         $this->addSql('ALTER TABLE task ADD offer_id INT DEFAULT NULL');
  37.         $this->addSql('ALTER TABLE task ADD CONSTRAINT FK_527EDB2553C674EE FOREIGN KEY (offer_id) REFERENCES offer (id)');
  38.         $this->addSql('CREATE INDEX IDX_527EDB2553C674EE ON task (offer_id)');
  39.         $this->addSql('DROP INDEX idx_527edb2538248176 ON task');
  40.         $this->addSql('CREATE INDEX FK_527EDB2538248176 ON task (currency_id)');
  41.         $this->addSql('ALTER TABLE task ADD CONSTRAINT FK_527EDB2538248176 FOREIGN KEY (currency_id) REFERENCES currency (id)');
  42.     }
  43. }