<?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 Version20240930100307 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('DROP INDEX IDX_ACDD24DBA63BC19 ON anthropometric_measures');
$this->addSql('ALTER TABLE anthropometric_measures CHANGE idPatient patient_diet_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE anthropometric_measures ADD CONSTRAINT FK_ACDD24DBBC826F25 FOREIGN KEY (patient_diet_id) REFERENCES patient_diet (id)');
$this->addSql('CREATE INDEX IDX_ACDD24DBBC826F25 ON anthropometric_measures (patient_diet_id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_147528E8C4477E9B ON patient_diet (id_patient)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE anthropometric_measures DROP FOREIGN KEY FK_ACDD24DBBC826F25');
$this->addSql('DROP INDEX IDX_ACDD24DBBC826F25 ON anthropometric_measures');
$this->addSql('ALTER TABLE anthropometric_measures CHANGE patient_diet_id idPatient INT DEFAULT NULL');
$this->addSql('CREATE INDEX IDX_ACDD24DBA63BC19 ON anthropometric_measures (idPatient)');
$this->addSql('DROP INDEX UNIQ_147528E8C4477E9B ON patient_diet');
}
}