diff --git a/core/metamodel.class.php b/core/metamodel.class.php index 3e100cacd..8a0661ea1 100644 --- a/core/metamodel.class.php +++ b/core/metamodel.class.php @@ -5646,32 +5646,9 @@ abstract class MetaModel $sView = self::DBGetView($sClass); if (CMDBSource::IsTable($sView)) { - // Check that the view is complete - // - // Note: checking the list of attributes is not enough because the columns can be stable while the SELECT is not stable - // Example: new way to compute the friendly name - // The correct comparison algorithm is to compare the queries, - // by using "SHOW CREATE VIEW" (MySQL 5.0.1 required) or to look into INFORMATION_SCHEMA/views - // both requiring some privileges - // Decision: to simplify, let's consider the views as being wrong anytime - // Rework the view - // - $oFilter = new DBObjectSearch($sClass, ''); - $oFilter->AllowAllData(); - $sSQL = $oFilter->MakeSelectQuery(); - $aErrors[$sClass]['*'][] = "Redeclare view '$sView' (systematic - to support an eventual change in the friendly name computation)"; - $aSugFix[$sClass]['*'][] = "ALTER VIEW `$sView` AS $sSQL"; - } - else - { - // Create the view - // - $oFilter = new DBObjectSearch($sClass, ''); - $oFilter->AllowAllData(); - $sSQL = $oFilter->MakeSelectQuery(); - $aErrors[$sClass]['*'][] = "Missing view for class: $sClass"; - $aSugFix[$sClass]['*'][] = "DROP VIEW IF EXISTS `$sView`"; - $aSugFix[$sClass]['*'][] = "CREATE VIEW `$sView` AS $sSQL"; + // Remove deprecated views + $aErrors[$sClass]['*'][] = "Remove view '$sView' (deprecated, consider installing combodo-views if needed)"; + $aSugFix[$sClass]['*'][] = "DROP VIEW `$sView`"; } } return array($aErrors, $aSugFix);