<?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 Version20250116085320 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// Ajouter la clé étrangère et l'index unique sur user_id
$this->addSql('ALTER TABLE nas_config ADD CONSTRAINT FK_F5B648A0A76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_F5B648A0A76ED395 ON nas_config (user_id)');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE nas_config DROP FOREIGN KEY FK_F5B648A0A76ED395');
$this->addSql('DROP INDEX UNIQ_F5B648A0A76ED395 ON nas_config');
}
}