protected function createTableIfDoesNotExist() : void
    {
        /**
         * Note: This is a somewhat hacky way to determine which database driver we're using
         * Ideally, in the future, the query builder will be able to create tables for us
         * Until then, we'll infer the database driver from the query builder type
         */
        switch (get_class($this->queryBuilder)) {
            case MySqlQueryBuilder::class:
                $sql = 'CREATE TABLE IF NOT EXISTS ' .
                    $this->tableName .
                    ' (migration varchar(255), dateran timestamp NOT NULL, PRIMARY KEY (migration));';
                break;
            case PostgreSqlQueryBuilder::class:
                $sql = 'CREATE TABLE IF NOT EXISTS ' .
                    $this->tableName .
                    ' (migration text primary key, dateran timestamp with time zone NOT NULL);';
                break;
            default:
                throw new RuntimeException('Unexpected query builder type ' . get_class($this->queryBuilder));
        }

        $statement = $this->connection->prepare($sql);
        $statement->execute();
    }
protected function createTableIfDoesNotExist() : void
    {
        /**
         * Note: This is a somewhat hacky way to determine which database driver we're using
         * Ideally, in the future, the query builder will be able to create tables for us
         * Until then, we'll infer the database driver from the query builder type
         */
        switch (get_class($this->queryBuilder)) {
            case MySqlQueryBuilder::class:
                $sql = 'CREATE TABLE IF NOT EXISTS ' .
                    $this->tableName .
                    ' (migration varchar(255), dateran timestamp NOT NULL, PRIMARY KEY (migration));';
                break;
            case PostgreSqlQueryBuilder::class:
                $sql = 'CREATE TABLE IF NOT EXISTS ' .
                    $this->tableName .
                    ' (migration text primary key, dateran timestamp with time zone NOT NULL);';
                break;
            default:
                throw new RuntimeException('Unexpected query builder type ' . get_class($this->queryBuilder));
        }

        $statement = $this->connection->prepare($sql);
        $statement->execute();
    }
protected function createTableIfDoesNotExist ( ) : void { /**
         * Note: This is a somewhat hacky way to determine which database driver we're using
         * Ideally, in the future, the query builder will be able to create tables for us
         * Until then, we'll infer the database driver from the query builder type
         */ switch ( get_class ( $ this -> queryBuilder ) ) { case MySqlQueryBuilder :: class : $ sql = 'CREATE TABLE IF NOT EXISTS ' . $ this -> tableName . ' (migration varchar(255), dateran timestamp NOT NULL, PRIMARY KEY (migration));' ; break ; case PostgreSqlQueryBuilder :: class : $ sql = 'CREATE TABLE IF NOT EXISTS ' . $ this -> tableName . ' (migration text primary key, dateran timestamp with time zone NOT NULL);' ; break ; default : throw new RuntimeException ( 'Unexpected query builder type ' . get_class ( $ this -> queryBuilder ) ) ; } $ statement = $ this -> connection -> prepare ( $ sql ) ; $ statement -> execute ( ) ; }
Creates the table that the migrations are stored in

@throws RuntimeException Thrown if the query builder wasn't a MySQL or PostgreSQL query builder
Creates the table that the migrations are stored in