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()