public function migrate(Name $name, Direction $direction, OutputInterface $output)
    {
        $migration = $this->createMigrationInstance($name, $output);

        $output->writeln('<info>Migrating ' . $direction . '...</info> <comment>' . $name . '</comment>');

        if ($direction->isUp()) {
            $migration->up($this->getDatabase());
            $this->setMigrationApplied($name, true);
        } else {
            $migration->down($this->getDatabase());
            $this->setMigrationApplied($name, false);
        }

        $output->writeln('<info>Migrated ' . $direction . '</info>');
    }