mirror of
https://github.com/grocy/grocy.git
synced 2025-08-17 11:06:36 +00:00
Removed type conversions where no longer needed
PHP 8.1 PDO SQLite now returns native data types
This commit is contained in:
@@ -45,8 +45,7 @@ class DatabaseMigrationService extends BaseService
|
||||
private function ExecutePhpMigrationWhenNeeded(int $migrationId, string $phpFile, int &$migrationCounter)
|
||||
{
|
||||
$rowCount = $this->getDatabaseService()->ExecuteDbQuery('SELECT COUNT(*) FROM migrations WHERE migration = ' . $migrationId)->fetchColumn();
|
||||
|
||||
if (intval($rowCount) === 0 || $migrationId == self::EMERGENCY_MIGRATION_ID || $migrationId == self::DOALWAYS_MIGRATION_ID)
|
||||
if ($rowCount == 0 || $migrationId == self::EMERGENCY_MIGRATION_ID || $migrationId == self::DOALWAYS_MIGRATION_ID)
|
||||
{
|
||||
include $phpFile;
|
||||
|
||||
@@ -61,8 +60,7 @@ class DatabaseMigrationService extends BaseService
|
||||
private function ExecuteSqlMigrationWhenNeeded(int $migrationId, string $sql, int &$migrationCounter)
|
||||
{
|
||||
$rowCount = $this->getDatabaseService()->ExecuteDbQuery('SELECT COUNT(*) FROM migrations WHERE migration = ' . $migrationId)->fetchColumn();
|
||||
|
||||
if (intval($rowCount) === 0 || $migrationId == self::EMERGENCY_MIGRATION_ID || $migrationId == self::DOALWAYS_MIGRATION_ID)
|
||||
if ($rowCount == 0 || $migrationId == self::EMERGENCY_MIGRATION_ID || $migrationId == self::DOALWAYS_MIGRATION_ID)
|
||||
{
|
||||
$this->getDatabaseService()->GetDbConnectionRaw()->beginTransaction();
|
||||
|
||||
|
Reference in New Issue
Block a user