Skip to content

Commit

Permalink
Correctly fix the migration now that we have an iterator.
Browse files Browse the repository at this point in the history
Can't use empty() on the iterator.
  • Loading branch information
mrubinsk committed May 13, 2015
1 parent 894d544 commit 516b2c3
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ public function up()
$seq = 1;

$this->beginDbTransaction();
$empty = true;
foreach ($rows as $row) {
$empty = false;
$this->update(
'UPDATE horde_histories SET history_modseq = ? WHERE history_id = ?',
array($seq++, $row['history_id']));
}
if (!empty($rows)) {
if (!$empty) {
$this->insert('INSERT INTO horde_histories_modseq (history_modseq) VALUES(?)', array($seq - 1));
}
$this->commitDbTransaction();
Expand Down

0 comments on commit 516b2c3

Please sign in to comment.