<?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 Version20251107204231 extends AbstractMigration
{
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 audit_event (id INT AUTO_INCREMENT NOT NULL, actor_id INT DEFAULT NULL, impersonator_id INT DEFAULT NULL, request_id VARCHAR(255) DEFAULT NULL, ip_address VARCHAR(255) DEFAULT NULL, user_agent VARCHAR(255) DEFAULT NULL, route VARCHAR(255) DEFAULT NULL, method VARCHAR(255) DEFAULT NULL, event_type VARCHAR(255) NOT NULL, target_type VARCHAR(255) DEFAULT NULL, target_id VARCHAR(255) DEFAULT NULL, operation VARCHAR(255) DEFAULT NULL, changes LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', created_at DATETIME NOT NULL, INDEX IDX_3CE56E50D1107CFF (impersonator_id), INDEX idx_actor (actor_id), INDEX idx_target (target_type, target_id), INDEX idx_type (event_type), INDEX idx_time (created_at), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$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');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE audit_event');
}
}