<?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 Version20220420092206 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 intrari CHANGE id_furnizor idFurnizor INT NOT NULL');
$this->addSql('ALTER TABLE intrari ADD CONSTRAINT FK_1CAAF5E5BD9BF413 FOREIGN KEY (idFurnizor) REFERENCES furnizor (id)');
$this->addSql('CREATE INDEX IDX_1CAAF5E5BD9BF413 ON intrari (idFurnizor)');
$this->addSql('ALTER TABLE oferta_produs DROP INDEX UNIQ_69DBD38EED3C9ECB, ADD INDEX IDX_69DBD38EED3C9ECB (idProdus)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE intrari DROP FOREIGN KEY FK_1CAAF5E5BD9BF413');
$this->addSql('DROP INDEX IDX_1CAAF5E5BD9BF413 ON intrari');
$this->addSql('ALTER TABLE intrari CHANGE idfurnizor id_furnizor INT NOT NULL');
$this->addSql('ALTER TABLE oferta_produs DROP INDEX IDX_69DBD38EED3C9ECB, ADD UNIQUE INDEX UNIQ_69DBD38EED3C9ECB (idProdus)');
}
}