public function applyMigration($state, $migration, $fake = false)
    {
        Console::stdout(sprintf(' Applying %s...', $migration->getName()));
        if (!$fake) {
            $state = $migration->apply(
                $state,
                $this->connection->getSchemaEditor()
            );
        }

        $this->recorder->recordApplied(
            [
                'name' => $migration->getName(),
                'app' => $migration->getAppLabel(),
            ]
        );

        if ($fake) {
            $end = Console::ansiFormat('FAKED', [Console::FG_GREEN]);
        } else {
            $end = Console::ansiFormat('OK', [Console::FG_GREEN]);
        }

        Console::stdout($end.PHP_EOL);

        return $state;
    }
public function applyMigration($state, $migration, $fake = false)
    {
        Console::stdout(sprintf(' Applying %s...', $migration->getName()));
        if (!$fake) {
            $state = $migration->apply(
                $state,
                $this->connection->getSchemaEditor()
            );
        }

        $this->recorder->recordApplied(
            [
                'name' => $migration->getName(),
                'app' => $migration->getAppLabel(),
            ]
        );

        if ($fake) {
            $end = Console::ansiFormat('FAKED', [Console::FG_GREEN]);
        } else {
            $end = Console::ansiFormat('OK', [Console::FG_GREEN]);
        }

        Console::stdout($end.PHP_EOL);

        return $state;
    }
public function applyMigration ( $ state , $ migration , $ fake = false ) { Console :: stdout ( sprintf ( ' Applying %s...' , $ migration -> getName ( ) ) ) ; if ( ! $ fake ) { $ state = $ migration -> apply ( $ state , $ this -> connection -> getSchemaEditor ( ) ) ; } $ this -> recorder -> recordApplied ( [ 'name' => $ migration -> getName ( ) , 'app' => $ migration -> getAppLabel ( ) , ] ) ; if ( $ fake ) { $ end = Console :: ansiFormat ( 'FAKED' , [ Console :: FG_GREEN ] ) ; } else { $ end = Console :: ansiFormat ( 'OK' , [ Console :: FG_GREEN ] ) ; } Console :: stdout ( $ end . PHP_EOL ) ; return $ state ; }
Applies the migration to the database.

@param ProjectState $state     this is the state before the migration is applied
@param Migration    $migration the migration to apply
@param bool         $fake

@return mixed

@throws \Eddmash\PowerOrm\Exception\NotImplemented
@throws \Exception

@since  1.1.0

@author Eddilbert Macharia (http://eddmash.com) <edd.cowan@gmail.com>
Applies the migration to the database .