From dae9f2a9ecd2dce4d10fdc430a4490c2d38db6f0 Mon Sep 17 00:00:00 2001 From: Jonathan Flueren <11487762+JonOfUs@users.noreply.github.com> Date: Wed, 13 Oct 2021 16:39:51 +0200 Subject: [PATCH] Change return value of migration to number of affected rows --- lib/Migration/TimestampMigration.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Migration/TimestampMigration.php b/lib/Migration/TimestampMigration.php index 141744f..dc6fb5f 100644 --- a/lib/Migration/TimestampMigration.php +++ b/lib/Migration/TimestampMigration.php @@ -32,7 +32,7 @@ class TimestampMigration implements \OCP\Migration\IRepairStep $queryTimestamps = 'SELECT id, timestamp FROM `*PREFIX*gpodder_episode_action` WHERE timestamp_epoch = 0'; $timestamps = $this->db->executeQuery($queryTimestamps)->fetchAll(); - $result = null; + $result = 0; foreach ($timestamps as $timestamp) { $timestampEpoch = (new DateTime($timestamp["timestamp"]))->format("U"); @@ -40,7 +40,7 @@ class TimestampMigration implements \OCP\Migration\IRepairStep . 'SET `timestamp_epoch` = ' . $timestampEpoch . ' ' . 'WHERE `id` = ' . $timestamp["id"]; - $result = $this->db->executeUpdate($sql); + $result += $this->db->executeUpdate($sql); }