Angejia\Pea\Blueprint::build PHP Method

build() public method

public build ( Connection $connection, Illuminate\Database\Schema\Grammars\Grammar $grammar )
$connection Illuminate\Database\Connection
$grammar Illuminate\Database\Schema\Grammars\Grammar
    public function build(Connection $connection, Grammar $grammar)
    {
        $statements = $this->toSql($connection, $grammar);
        if (!$statements) {
            throw new \RuntimeException('migration must be created with Blueprint');
        }
        foreach ($statements as $statement) {
            $connection->statement($statement);
        }
        $db = $connection->getDatabaseName();
        $table = $this->getTable();
        $this->meta->flushAll($db, $table);
    }