mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-29 19:13:49 +00:00
update some queries in the interface to take into account history of user's scope and user's job
This commit is contained in:
@@ -12,6 +12,7 @@ declare(strict_types=1);
|
||||
namespace Chill\MainBundle\Service\EntityInfo;
|
||||
|
||||
use Doctrine\DBAL\Connection;
|
||||
use Psr\Log\LoggerInterface;
|
||||
|
||||
class ViewEntityInfoManager
|
||||
{
|
||||
@@ -21,6 +22,7 @@ class ViewEntityInfoManager
|
||||
*/
|
||||
private readonly iterable $vienEntityInfoProviders,
|
||||
private readonly Connection $connection,
|
||||
private readonly LoggerInterface $logger,
|
||||
) {}
|
||||
|
||||
public function synchronizeOnDB(): void
|
||||
@@ -28,6 +30,8 @@ class ViewEntityInfoManager
|
||||
$this->connection->transactional(function (Connection $conn): void {
|
||||
foreach ($this->vienEntityInfoProviders as $viewProvider) {
|
||||
foreach ($this->createOrReplaceViewSQL($viewProvider, $viewProvider->getViewName()) as $sql) {
|
||||
$this->logger->debug("Will execute create view sql", ['sql' => $sql]);
|
||||
$this->logger->debug($sql);
|
||||
$conn->executeQuery($sql);
|
||||
}
|
||||
}
|
||||
@@ -41,7 +45,7 @@ class ViewEntityInfoManager
|
||||
{
|
||||
return [
|
||||
"DROP VIEW IF EXISTS {$viewName}",
|
||||
sprintf("CREATE VIEW {$viewName} AS %s", $viewProvider->getViewQuery())
|
||||
sprintf("CREATE OR REPLACE VIEW {$viewName} AS %s", $viewProvider->getViewQuery())
|
||||
];
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user