<?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 Version20230316145425 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 currency CHANGE value value NUMERIC(10, 6) NOT NULL');
$this->addSql('ALTER TABLE task DROP FOREIGN KEY FK_527EDB2553C674EE');
$this->addSql('DROP INDEX IDX_527EDB2553C674EE ON task');
$this->addSql('ALTER TABLE task DROP FOREIGN KEY FK_527EDB2538248176');
$this->addSql('ALTER TABLE task DROP offer_id');
$this->addSql('ALTER TABLE task ADD CONSTRAINT FK_527EDB25DAADA679 FOREIGN KEY (task_type_id) REFERENCES task_type (id)');
$this->addSql('CREATE INDEX IDX_527EDB25DAADA679 ON task (task_type_id)');
$this->addSql('DROP INDEX fk_527edb2538248176 ON task');
$this->addSql('CREATE INDEX IDX_527EDB2538248176 ON task (currency_id)');
$this->addSql('ALTER TABLE task ADD CONSTRAINT FK_527EDB2538248176 FOREIGN KEY (currency_id) REFERENCES currency (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE currency CHANGE value value NUMERIC(10, 0) NOT NULL');
$this->addSql('ALTER TABLE task DROP FOREIGN KEY FK_527EDB25DAADA679');
$this->addSql('DROP INDEX IDX_527EDB25DAADA679 ON task');
$this->addSql('ALTER TABLE task DROP FOREIGN KEY FK_527EDB2538248176');
$this->addSql('ALTER TABLE task ADD offer_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE task ADD CONSTRAINT FK_527EDB2553C674EE FOREIGN KEY (offer_id) REFERENCES offer (id)');
$this->addSql('CREATE INDEX IDX_527EDB2553C674EE ON task (offer_id)');
$this->addSql('DROP INDEX idx_527edb2538248176 ON task');
$this->addSql('CREATE INDEX FK_527EDB2538248176 ON task (currency_id)');
$this->addSql('ALTER TABLE task ADD CONSTRAINT FK_527EDB2538248176 FOREIGN KEY (currency_id) REFERENCES currency (id)');
}
}