From 54a2a721cb529cb9770eecaebcf13a3c2fd27ff5 Mon Sep 17 00:00:00 2001 From: Daniel Seifert Date: Mon, 19 Dec 2022 10:59:38 +0100 Subject: [PATCH] perform a views regenerating --- src/Setup/Actions.php | 12 ++++++++++++ src/Setup/Events.php | 1 + 2 files changed, 13 insertions(+) diff --git a/src/Setup/Actions.php b/src/Setup/Actions.php index a2c4a95..f565eea 100644 --- a/src/Setup/Actions.php +++ b/src/Setup/Actions.php @@ -20,6 +20,7 @@ use Doctrine\DBAL\Driver\Exception as DoctrineDriverException; use Doctrine\DBAL\Exception as DoctrineException; use Doctrine\DBAL\Query\QueryBuilder; use OxidEsales\Eshop\Core\DatabaseProvider; +use OxidEsales\Eshop\Core\DbMetaDataHandler; use OxidEsales\Eshop\Core\Exception\DatabaseConnectionException; use OxidEsales\Eshop\Core\Exception\DatabaseErrorException; use OxidEsales\Eshop\Core\Exception\DatabaseException; @@ -48,6 +49,17 @@ class Actions } } + + + /** + * Regenerate views for changed tables + */ + public function regenerateViews() + { + $oDbMetaDataHandler = oxNew(DbMetaDataHandler::class); + $oDbMetaDataHandler->updateViews(); + } + /** * @return bool * @throws ContainerExceptionInterface diff --git a/src/Setup/Events.php b/src/Setup/Events.php index fd29ee9..9cc4892 100644 --- a/src/Setup/Events.php +++ b/src/Setup/Events.php @@ -38,6 +38,7 @@ class Events /** @var Actions $actions */ $actions = oxNew(Actions::class); $actions->setupDatabase(); + $actions->regenerateViews(); } public static function onDeactivate()