From b67781fe232e42ad081956c37328442f97e4af1a Mon Sep 17 00:00:00 2001 From: Brock H Caldwell Date: Sun, 2 Nov 2025 16:16:19 -0600 Subject: [PATCH] fix: adds created/updated at to event log --- migrations/Version20251102221034.php | 35 ++++++++++++++++++++++ src/EventLog/Framework/Entity/EventLog.php | 3 ++ 2 files changed, 38 insertions(+) create mode 100644 migrations/Version20251102221034.php diff --git a/migrations/Version20251102221034.php b/migrations/Version20251102221034.php new file mode 100644 index 0000000..918996e --- /dev/null +++ b/migrations/Version20251102221034.php @@ -0,0 +1,35 @@ +addSql(<<<'SQL' + ALTER TABLE event_log ADD created_at DATETIME NULL, ADD updated_at DATETIME NULL + SQL); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql(<<<'SQL' + ALTER TABLE event_log DROP created_at, DROP updated_at + SQL); + } +} diff --git a/src/EventLog/Framework/Entity/EventLog.php b/src/EventLog/Framework/Entity/EventLog.php index 734d587..9f83fd3 100644 --- a/src/EventLog/Framework/Entity/EventLog.php +++ b/src/EventLog/Framework/Entity/EventLog.php @@ -6,10 +6,13 @@ use App\EventLog\Framework\Repository\EventLogRepository; use App\User\Framework\Entity\User; use Doctrine\DBAL\Types\Types; use Doctrine\ORM\Mapping as ORM; +use Gedmo\Timestampable\Traits\TimestampableEntity; #[ORM\Entity(repositoryClass: EventLogRepository::class)] class EventLog { + use TimestampableEntity; + #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column(nullable: true)]