Merge pull request 'FIX: check missing table' (#33) from feature/skip-deprecated into develop
Reviewed-on: #33
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user