<?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 Version20250306130458 extends AbstractMigration
{
public function isTransactional(): bool
{
return false;
}
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('CREATE TABLE channel_user_data_cursus_report_details (id INT AUTO_INCREMENT NOT NULL, cursus_id INT NOT NULL, old_session_id INT DEFAULT NULL, old_start_at DATE DEFAULT NULL, old_end_at DATE DEFAULT NULL, details TEXT NOT NULL, INDEX IDX_423E645B40AEF4B9 (cursus_id), INDEX IDX_423E645BDD1CDB81 (old_session_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE channel_user_data_cursus_report_details ADD CONSTRAINT FK_423E645B40AEF4B9 FOREIGN KEY (cursus_id) REFERENCES channel_user_data_cursus (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE channel_user_data_cursus_report_details ADD CONSTRAINT FK_423E645BDD1CDB81 FOREIGN KEY (old_session_id) REFERENCES channel_sessions (id) ON DELETE SET NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE channel_user_data_cursus_report_details DROP FOREIGN KEY FK_423E645B40AEF4B9');
$this->addSql('ALTER TABLE channel_user_data_cursus_report_details DROP FOREIGN KEY FK_423E645BDD1CDB81');
$this->addSql('DROP TABLE channel_user_data_cursus_report_details');
}
}