<?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 Version20250416115651 extends AbstractMigration
{
public function getDescription(): string
{
return 'Add foreign key to reference company_entity';
}
public function up(Schema $schema): void
{
// Add foreign key to company_entity
$this->addSql('ALTER TABLE user ADD CONSTRAINT FK_8D93D64981257D5D FOREIGN KEY (entity_id) REFERENCES company_entity (id)');
}
public function down(Schema $schema): void
{
// Remove the foreign key
$this->addSql('ALTER TABLE user DROP FOREIGN KEY FK_8D93D64981257D5D');
}
}