Skip to content

Commit

Permalink
Fix: Missing fix for Postgre & MSSQL
Browse files Browse the repository at this point in the history
  • Loading branch information
iRedds committed Jun 17, 2022
1 parent b0823ec commit 11f57e5
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
16 changes: 14 additions & 2 deletions system/Database/Postgre/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,13 @@ public function increment(string $column, int $value = 1)

$sql = $this->_update($this->QBFrom[0], [$column => "to_number({$column}, '9999999') + {$value}"]);

return $this->db->query($sql, $this->binds, false);
if (! $this->testMode) {
$this->resetWrite();

return $this->db->query($sql, $this->binds, false);
}

return true;
}

/**
Expand All @@ -112,7 +118,13 @@ public function decrement(string $column, int $value = 1)

$sql = $this->_update($this->QBFrom[0], [$column => "to_number({$column}, '9999999') - {$value}"]);

return $this->db->query($sql, $this->binds, false);
if (! $this->testMode) {
$this->resetWrite();

return $this->db->query($sql, $this->binds, false);
}

return true;
}

/**
Expand Down
16 changes: 14 additions & 2 deletions system/Database/SQLSRV/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,13 @@ public function increment(string $column, int $value = 1)

$sql = $this->_update($this->QBFrom[0], $values);

return $this->db->query($sql, $this->binds, false);
if (! $this->testMode) {
$this->resetWrite();

return $this->db->query($sql, $this->binds, false);
}

return true;
}

/**
Expand All @@ -275,7 +281,13 @@ public function decrement(string $column, int $value = 1)

$sql = $this->_update($this->QBFrom[0], $values);

return $this->db->query($sql, $this->binds, false);
if (! $this->testMode) {
$this->resetWrite();

return $this->db->query($sql, $this->binds, false);
}

return true;
}

/**
Expand Down

0 comments on commit 11f57e5

Please sign in to comment.