private function isMigrated($migration, OutputInterface $output = null)
    {
        if ($this->_db->schema()->hasTable('migrations')) {
            $table = $this->_cap->table('migrations');
            $m = $table->where('migration', '=', $migration);
            if ($m->count() > 0) {
                $item = $m->first();
                if ($item->migrated == 1) {
                    return true;
                }
            }
        } else {
            $this->createMigrationsTable($output);

            return $this->isMigrated($migration);
        }

        return false;
    }
private function isMigrated($migration, OutputInterface $output = null)
    {
        if ($this->_db->schema()->hasTable('migrations')) {
            $table = $this->_cap->table('migrations');
            $m = $table->where('migration', '=', $migration);
            if ($m->count() > 0) {
                $item = $m->first();
                if ($item->migrated == 1) {
                    return true;
                }
            }
        } else {
            $this->createMigrationsTable($output);

            return $this->isMigrated($migration);
        }

        return false;
    }
private function isMigrated ( $ migration , OutputInterface $ output = null ) { if ( $ this -> _db -> schema ( ) -> hasTable ( 'migrations' ) ) { $ table = $ this -> _cap -> table ( 'migrations' ) ; $ m = $ table -> where ( 'migration' , '=' , $ migration ) ; if ( $ m -> count ( ) > 0 ) { $ item = $ m -> first ( ) ; if ( $ item -> migrated == 1 ) { return true ; } } } else { $ this -> createMigrationsTable ( $ output ) ; return $ this -> isMigrated ( $ migration ) ; } return false ; }
Check whether a migration is in the database or not.

@param string                                            $migration
@param \Symfony\Component\Console\Output\OutputInterface $output

@return bool
Check whether a migration is in the database or not .