public function execute($args) { echo "Started: " . date('Y-m-d g:ia T') . "\n\n"; echo "[db:status]: \n"; $util = new Ruckusing_MigratorUtil($this->get_adapter()); $migrations = $util->get_executed_migrations(); $files = $util->get_migration_files($this->get_framework()->migrations_directory(), 'up'); $applied = array(); $not_applied = array(); foreach ($files as $file) { if (in_array($file['version'], $migrations)) { $applied[] = $file['class'] . ' [ ' . $file['version'] . ' ]'; } else { $not_applied[] = $file['class'] . ' [ ' . $file['version'] . ' ]'; } } echo "\n\n===================== APPLIED ======================= \n"; foreach ($applied as $a) { echo "\t" . $a . "\n"; } echo "\n\n===================== NOT APPLIED ======================= \n"; foreach ($not_applied as $na) { echo "\t" . $na . "\n"; } echo "\n\nFinished: " . date('Y-m-d g:ia T') . "\n\n"; }
public function test_resolve_current_version_going_down() { $this->clear_dummy_data(); $this->insert_dummy_version_data(array(1, 2, 3)); $migrator_util = new Ruckusing_MigratorUtil($this->adapter); $migrator_util->resolve_current_version(3, 'down'); $executed = $migrator_util->get_executed_migrations(); $this->assertEquals(false, in_array(3, $executed)); $this->assertEquals(true, in_array(1, $executed)); $this->assertEquals(true, in_array(2, $executed)); }