Пример #1
0
 /**
  * Drops the stored routine if it exists.
  */
 private function dropRoutine()
 {
     if (isset($this->rdbmsOldRoutineMetadata)) {
         MetaDataLayer::dropRoutine($this->rdbmsOldRoutineMetadata['routine_type'], $this->routineName);
     }
 }
Пример #2
0
 /**
  * Drops obsolete stored routines (i.e. stored routines that exits in the current schema but for which we don't have
  * a source file).
  */
 private function dropObsoleteRoutines()
 {
     // Make a lookup table from routine name to source.
     $lookup = [];
     foreach ($this->mySources as $source) {
         $lookup[$source['routine_name']] = $source;
     }
     // Drop all routines not longer in sources.
     foreach ($this->myRdbmsOldMetadata as $old_routine) {
         if (!isset($lookup[$old_routine['routine_name']])) {
             $this->io->logInfo('Dropping %s <dbo>%s</dbo>', strtolower($old_routine['routine_type']), $old_routine['routine_name']);
             DataLayer::dropRoutine($old_routine['routine_type'], $old_routine['routine_name']);
         }
     }
 }