Skip to content
This repository was archived by the owner on Oct 1, 2024. It is now read-only.

Commit f20044a

Browse files
authored
Merge pull request #70 from 4CME/master
[UPD] - Mapped functions to public schema - FIX #68
2 parents a561458 + 9eacbac commit f20044a

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

src/Eloquent/Builder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ protected function getPostgisFields()
2424

2525
protected function asWKT(GeometryInterface $geometry)
2626
{
27-
return $this->getQuery()->raw(sprintf("ST_GeogFromText('%s')", $geometry->toWKT()));
27+
return $this->getQuery()->raw(sprintf("public.ST_GeogFromText('%s')", $geometry->toWKT()));
2828
}
2929
}

src/Eloquent/PostgisTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ protected function performInsert(EloquentBuilder $query, array $options = [])
2626
foreach ($this->attributes as $key => $value) {
2727
if ($value instanceof GeometryInterface && ! $value instanceof GeometryCollection) {
2828
$this->geometries[$key] = $value; //Preserve the geometry objects prior to the insert
29-
$this->attributes[$key] = $this->getConnection()->raw(sprintf("ST_GeogFromText('%s')", $value->toWKT()));
29+
$this->attributes[$key] = $this->getConnection()->raw(sprintf("public.ST_GeogFromText('%s')", $value->toWKT()));
3030
} else if ($value instanceof GeometryInterface && $value instanceof GeometryCollection) {
3131
$this->geometries[$key] = $value; //Preserve the geometry objects prior to the insert
32-
$this->attributes[$key] = $this->getConnection()->raw(sprintf("ST_GeomFromText('%s', 4326)", $value->toWKT()));
32+
$this->attributes[$key] = $this->getConnection()->raw(sprintf("public.ST_GeomFromText('%s', 4326)", $value->toWKT()));
3333
}
3434
}
3535

tests/Eloquent/BuilderTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ public function testUpdate()
4646
{
4747
$this->queryBuilder
4848
->shouldReceive('raw')
49-
->with("ST_GeogFromText('POINT(2 1)')")
50-
->andReturn(new Expression("ST_GeogFromText('POINT(2 1)')"));
49+
->with("public.ST_GeogFromText('POINT(2 1)')")
50+
->andReturn(new Expression("public.ST_GeogFromText('POINT(2 1)')"));
5151

5252
$this->queryBuilder
5353
->shouldReceive('update')
@@ -66,8 +66,8 @@ public function testUpdateLinestring()
6666
{
6767
$this->queryBuilder
6868
->shouldReceive('raw')
69-
->with("ST_GeogFromText('LINESTRING(0 0, 1 1, 2 2)')")
70-
->andReturn(new Expression("ST_GeogFromText('LINESTRING(0 0, 1 1, 2 2)')"));
69+
->with("public.ST_GeogFromText('LINESTRING(0 0, 1 1, 2 2)')")
70+
->andReturn(new Expression("public.ST_GeogFromText('LINESTRING(0 0, 1 1, 2 2)')"));
7171

7272
$this->queryBuilder
7373
->shouldReceive('update')

tests/Eloquent/PostgisTraitTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function testInsertPointHasCorrectSql()
3434
$this->model->point = new Point(1, 2);
3535
$this->model->save();
3636

37-
$this->assertContains("ST_GeogFromText('POINT(2 1)')", $this->queries[0]);
37+
$this->assertContains("public.ST_GeogFromText('POINT(2 1)')", $this->queries[0]);
3838
}
3939

4040
public function testUpdatePointHasCorrectSql()
@@ -43,7 +43,7 @@ public function testUpdatePointHasCorrectSql()
4343
$this->model->point = new Point(2, 4);
4444
$this->model->save();
4545

46-
$this->assertContains("ST_GeogFromText('POINT(4 2)')", $this->queries[0]);
46+
$this->assertContains("public.ST_GeogFromText('POINT(4 2)')", $this->queries[0]);
4747
}
4848
}
4949

0 commit comments

Comments
 (0)