<?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 Version20251124190356 extends AbstractMigration
{
// administrator-audit-events
public const REPORT_ID_1 = 60;
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('DROP TABLE audit_event');
$this->addSql(sprintf('DELETE FROM report WHERE id = %d', self::REPORT_ID_1));
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE audit_event (id INT AUTO_INCREMENT NOT NULL, actor_id INT DEFAULT NULL, impersonator_id INT DEFAULT NULL, target_type VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, target_id VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, operation VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, changes LONGTEXT CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci` COMMENT \'(DC2Type:array)\', created_at DATETIME NOT NULL, INDEX idx_actor (actor_id), INDEX IDX_3CE56E50D1107CFF (impersonator_id), INDEX idx_target (target_type, target_id), INDEX idx_time (created_at), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('ALTER TABLE audit_event ADD CONSTRAINT FK_3CE56E5010DAF24A FOREIGN KEY (actor_id) REFERENCES user (id) ON DELETE SET NULL');
$this->addSql('ALTER TABLE audit_event ADD CONSTRAINT FK_3CE56E50D1107CFF FOREIGN KEY (impersonator_id) REFERENCES user (id) ON DELETE SET NULL');
$this->addSql(sprintf('INSERT INTO report (id, token, name, category, enabled, sort_order) VALUES (%d, \'administrator-audit-events\', \'Audit Events\', \'Management\', 1, 7)', self::REPORT_ID_1));
}
}