migrations/Version20230316095612.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 Version20230316095612 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 project ADD CONSTRAINT FK_2FB3D0EE38248176 FOREIGN KEY (currency_id) REFERENCES currency (id)');
  19.         $this->addSql('CREATE INDEX IDX_2FB3D0EE38248176 ON project (currency_id)');
  20.         $this->addSql('ALTER TABLE task ADD task_type_id INT NOT NULL');
  21.         $this->addSql('ALTER TABLE task ADD CONSTRAINT FK_527EDB2538248176 FOREIGN KEY (currency_id) REFERENCES currency (id)');
  22.         $this->addSql('ALTER TABLE task ADD CONSTRAINT FK_527EDB25DAADA679 FOREIGN KEY (task_type_id) REFERENCES task_type (id)');
  23.         $this->addSql('CREATE INDEX IDX_527EDB2538248176 ON task (currency_id)');
  24.         $this->addSql('CREATE INDEX IDX_527EDB25DAADA679 ON task (task_type_id)');
  25.     }
  26.     public function down(Schema $schema): void
  27.     {
  28.         // this down() migration is auto-generated, please modify it to your needs
  29.         $this->addSql('ALTER TABLE project DROP FOREIGN KEY FK_2FB3D0EE38248176');
  30.         $this->addSql('DROP INDEX IDX_2FB3D0EE38248176 ON project');
  31.         $this->addSql('ALTER TABLE task DROP FOREIGN KEY FK_527EDB2538248176');
  32.         $this->addSql('ALTER TABLE task DROP FOREIGN KEY FK_527EDB25DAADA679');
  33.         $this->addSql('DROP INDEX IDX_527EDB2538248176 ON task');
  34.         $this->addSql('DROP INDEX IDX_527EDB25DAADA679 ON task');
  35.         $this->addSql('ALTER TABLE task DROP task_type_id');
  36.     }
  37. }