src/Console/Commands/Migrations/RemoveCommand.php
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->bootstrap($input, $output);

        $migrations = $this->getMigrations();
        $versions   = $this->getAdapter()->fetchAll();

        $version = $input->getArgument('version');

        if (in_array($version, $versions)) {
            $output->writeLn('<error>-Error!</error> "'.$version.'" migration is active. Please down it first.');
            return;
        }

        if (!isset($migrations[$version])) {
            $output->writeLn('<error>-Error!</error> "'.$version.'" migration not found. Please check migration ID.');
            return;
        }

        $mask = glob(database_path('migrations/'.$version.'_*.php'));
        array_map('unlink', $mask);
        $output->writeLn('<info>+Success!</info> "'.$version.'" migration removed.');
    }
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->bootstrap($input, $output);

        $migrations = $this->getMigrations();
        $versions   = $this->getAdapter()->fetchAll();

        $version = $input->getArgument('version');

        if (in_array($version, $versions)) {
            $output->writeLn('<error>-Error!</error> "'.$version.'" migration is active. Please down it first.');
            return;
        }

        if (!isset($migrations[$version])) {
            $output->writeLn('<error>-Error!</error> "'.$version.'" migration not found. Please check migration ID.');
            return;
        }

        $mask = glob(database_path('migrations/'.$version.'_*.php'));
        array_map('unlink', $mask);
        $output->writeLn('<info>+Success!</info> "'.$version.'" migration removed.');
    }
protected function execute ( InputInterface $ input , OutputInterface $ output ) { $ this -> bootstrap ( $ input , $ output ) ; $ migrations = $ this -> getMigrations ( ) ; $ versions = $ this -> getAdapter ( ) -> fetchAll ( ) ; $ version = $ input -> getArgument ( 'version' ) ; if ( in_array ( $ version , $ versions ) ) { $ output -> writeLn ( '<error>-Error!</error> "' . $ version . '" migration is active. Please down it first.' ) ; return ; } if ( ! isset ( $ migrations [ $ version ] ) ) { $ output -> writeLn ( '<error>-Error!</error> "' . $ version . '" migration not found. Please check migration ID.' ) ; return ; } $ mask = glob ( database_path ( 'migrations/' . $ version . '_*.php' ) ) ; array_map ( 'unlink' , $ mask ) ; $ output -> writeLn ( '<info>+Success!</info> "' . $ version . '" migration removed.' ) ; }
{@inheritdoc}
{