<?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 Version20240326130042 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
$this->addSql(
'ALTER TABLE health_report_submission_files
DROP FOREIGN KEY FK_8371AB18825015F'
);
$this->addSql('DROP INDEX IDX_8371AB18825015F ON health_report_submission_files');
$this->addSql(
'ALTER TABLE health_report_submission_files
CHANGE health_report_submissions_id health_report_submission_id INT UNSIGNED NOT NULL'
);
$this->addSql(
'ALTER TABLE health_report_submission_files
ADD CONSTRAINT FK_8371AB1E4CB9BD6 FOREIGN KEY (health_report_submission_id)
REFERENCES health_report_submissions (id)
ON DELETE CASCADE'
);
$this->addSql(
'CREATE INDEX IDX_8371AB1E4CB9BD6
ON health_report_submission_files (health_report_submission_id)'
);
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql(
'ALTER TABLE health_report_submission_files DROP FOREIGN KEY FK_8371AB1E4CB9BD6'
);
$this->addSql(
'DROP INDEX IDX_8371AB1E4CB9BD6 ON health_report_submission_files'
);
$this->addSql(
'ALTER TABLE health_report_submission_files
CHANGE health_report_submission_id health_report_submissions_id INT UNSIGNED NOT NULL'
);
$this->addSql(
'ALTER TABLE health_report_submission_files
ADD CONSTRAINT FK_8371AB18825015F FOREIGN KEY (health_report_submissions_id)
REFERENCES health_report_submissions (id) ON UPDATE NO ACTION ON DELETE CASCADE'
);
$this->addSql(
'CREATE INDEX IDX_8371AB18825015F
ON health_report_submission_files (health_report_submissions_id)'
);
}
}