protected function runMigrationByApplication($command)
    {
        $app = $this->mockApplication();

        list($migrateController, $route) = $app->createController('migrate');

        if ($migrateController === null) {
            throw new ExtensionException(
              __CLASS__,
              "At least one of `migrationPath` or `migrationNamespaces` should be specified.\nOr describe migrations in your app config."
            );
        }

        if ($migrateController->interactive) {
            $this->writeln('Cannot run the migrate interactively, the interaction was disabled.');
            $migrateController->interactive = false;
        }

        $this->runMigration($migrateController, $command);

        $this->destroyApplication();
    }