Пример #1
0
 /**
  * Single purge step that reverts any included and installed migrations
  *
  * @param mixed $old_state State returned by previous call of this method
  * @return false Indicates no further steps are required
  */
 public function purge_step($old_state)
 {
     $migrations = $this->get_migration_file_list();
     $this->migrator->set_migrations($migrations);
     foreach ($migrations as $migration) {
         while ($this->migrator->migration_state($migration) !== false) {
             $this->migrator->revert($migration);
             return true;
         }
     }
     return false;
 }
Пример #2
0
 protected function load_migrations()
 {
     $migrations = $this->extension_manager->get_finder()->core_path('src/db/migration/data/')->extension_directory('/migrations')->get_classes();
     $this->migrator->set_migrations($migrations);
 }