Skip to content

Commit

Permalink
Merge pull request #65 from njbarrett/master
Browse files Browse the repository at this point in the history
Updating query scopes branch
  • Loading branch information
njbarrett committed Jan 16, 2017
2 parents 3c9ae38 + 5af1d26 commit 71b2cca
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ class Location extends Model
];

protected $postgisFields = [
Point::class,
Polygon::class,
'location',
'polygon',
];

}
Expand Down
8 changes: 8 additions & 0 deletions src/PostgisConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

class PostgisConnection extends \Bosnadev\Database\PostgresConnection
{
public function __construct($pdo, $database = '', $tablePrefix = '', array $config = [])
{
parent::__construct($pdo, $database, $tablePrefix, $config);

// Prevent geography type fields from throwing a 'type not found' error.
$this->getDoctrineSchemaManager()->getDatabasePlatform()->registerDoctrineTypeMapping('geography', 'string');
}

/**
* Get the default schema grammar instance.
*
Expand Down

0 comments on commit 71b2cca

Please sign in to comment.