Files
myep-team/migrations/Version20251223131716.php
T
2025-12-23 14:54:27 +01:00

36 lines
1.2 KiB
PHP

<?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 Version20251223131716 extends AbstractMigration
{
public function getDescription(): string
{
return 'Add feedback_set_id relation to feedback table';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE feedback ADD feedback_set_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE feedback ADD CONSTRAINT FK_D22944582DB73956 FOREIGN KEY (feedback_set_id) REFERENCES feedback_set (id) ON DELETE SET NULL');
$this->addSql('CREATE INDEX IDX_D22944582DB73956 ON feedback (feedback_set_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE feedback DROP FOREIGN KEY FK_D22944582DB73956');
$this->addSql('DROP INDEX IDX_D22944582DB73956 ON feedback');
$this->addSql('ALTER TABLE feedback DROP feedback_set_id');
}
}