<?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 Version20221024095446 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 sarcini ADD proiectId INT DEFAULT NULL, ADD prospectId INT DEFAULT NULL');
$this->addSql('ALTER TABLE sarcini ADD CONSTRAINT FK_A1D34D0FEA071259 FOREIGN KEY (proiectId) REFERENCES projects (id)');
$this->addSql('ALTER TABLE sarcini ADD CONSTRAINT FK_A1D34D0F5422428C FOREIGN KEY (prospectId) REFERENCES prospect (id)');
$this->addSql('CREATE INDEX IDX_A1D34D0FEA071259 ON sarcini (proiectId)');
$this->addSql('CREATE INDEX IDX_A1D34D0F5422428C ON sarcini (prospectId)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE sarcini DROP FOREIGN KEY FK_A1D34D0FEA071259');
$this->addSql('ALTER TABLE sarcini DROP FOREIGN KEY FK_A1D34D0F5422428C');
$this->addSql('DROP INDEX IDX_A1D34D0FEA071259 ON sarcini');
$this->addSql('DROP INDEX IDX_A1D34D0F5422428C ON sarcini');
$this->addSql('ALTER TABLE sarcini ADD proiect_id INT DEFAULT NULL, ADD prospect_id INT DEFAULT NULL, DROP proiectId, DROP prospectId');
}
}