From 48888ff6bed7888dcae54ff98c2985a2e312c446 Mon Sep 17 00:00:00 2001 From: Chuck Adams Date: Fri, 6 Dec 2024 09:48:22 -0700 Subject: [PATCH] minor db and type fixes (#39) * fix: s/created/added/ * fix: cast version to string, as it's sometimes numeric --- src/Services/List/AbstractListService.php | 2 +- src/Services/Metadata/AbstractMetadataService.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Services/List/AbstractListService.php b/src/Services/List/AbstractListService.php index 5a813a0..15a7180 100644 --- a/src/Services/List/AbstractListService.php +++ b/src/Services/List/AbstractListService.php @@ -53,7 +53,7 @@ public function preserveRevision(): string $revision = $this->currentRevision[$name]['revision']; $this->em->getConnection()->insert( 'revisions', - ['action' => $name, 'revision' => $revision, 'created' => time()] + ['action' => $name, 'revision' => $revision, 'added' => time()] ); return (string) $revision; } diff --git a/src/Services/Metadata/AbstractMetadataService.php b/src/Services/Metadata/AbstractMetadataService.php index 53370f3..7877749 100644 --- a/src/Services/Metadata/AbstractMetadataService.php +++ b/src/Services/Metadata/AbstractMetadataService.php @@ -51,7 +51,7 @@ protected function saveOpen(array $metadata): void 'slug' => mb_substr($metadata['slug'], 0, 255), 'name' => mb_substr($metadata['name'], 0, 255), 'status' => 'open', - 'version' => mb_substr($metadata['version'], 0, 32), + 'version' => mb_substr((string) $metadata['version'], 0, 32), 'origin' => $this->origin, 'updated' => strtotime($metadata['last_updated'] ?? 'now'), 'pulled' => time(),