<?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 Version20220419090659 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 oferta_produs ADD idProdus INT NOT NULL, DROP id_produs');
$this->addSql('ALTER TABLE oferta_produs ADD CONSTRAINT FK_69DBD38EED3C9ECB FOREIGN KEY (idProdus) REFERENCES products (id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_69DBD38EED3C9ECB ON oferta_produs (idProdus)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE oferta_produs DROP FOREIGN KEY FK_69DBD38EED3C9ECB');
$this->addSql('DROP INDEX UNIQ_69DBD38EED3C9ECB ON oferta_produs');
$this->addSql('ALTER TABLE oferta_produs ADD id_produs INT DEFAULT NULL, DROP idProdus');
}
}