FIX: check missing table #33

Merged
aldarien merged 1 commits from feature/skip-deprecated into develop 2025-09-11 17:52:11 -03:00
Showing only changes of commit 1945c5728a - Show all commits

View File

@ -5,6 +5,7 @@ use Incoviba\Common\Define\Connection;
use Monolog\Handler\AbstractProcessingHandler;
use Monolog\Level;
use Monolog\LogRecord;
use PDOException;
use PDOStatement;
class MySQL extends AbstractProcessingHandler
@ -69,13 +70,21 @@ QUERY;
private function checkTableExists(): bool
{
$query = "SHOW TABLES LIKE 'monolog'";
try {
$result = $this->connection->query($query);
} catch (PDOException) {
return false;
}
return $result->rowCount() > 0;
}
private function checkTableDeprecatedExists(): bool
{
$query = "SHOW TABLES LIKE 'monolog_deprecated'";
try {
$result = $this->connection->query($query);
} catch (PDOException) {
return false;
}
return $result->rowCount() > 0;
}
private function createTable(): void