Change return value of migration to number of affected rows

This commit is contained in:
Jonathan Flueren 2021-10-13 16:39:51 +02:00 committed by thrillfall
parent 6dd54198f6
commit dae9f2a9ec
1 changed files with 2 additions and 2 deletions

View File

@ -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);
}