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