Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/Illuminate/Database/Schema/Grammars/PostgresGrammar.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Illuminate\Database\Schema\Grammars;

use RuntimeException;
use Illuminate\Support\Fluent;
use Illuminate\Database\Schema\Blueprint;

Expand Down Expand Up @@ -725,11 +724,11 @@ protected function typeMacAddress(Fluent $column)
* Create the column definition for a spatial Geometry type.
*
* @param \Illuminate\Support\Fluent $column
* @throws \RuntimeException
* @return string
*/
protected function typeGeometry(Fluent $column)
{
throw new RuntimeException('The database driver in use does not support the Geometry spatial column type.');
return $this->formatPostGisType('geometry');
}

/**
Expand Down
9 changes: 4 additions & 5 deletions tests/Database/DatabasePostgresSchemaGrammarTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -702,15 +702,14 @@ public function testCompileForeign()
$this->assertEquals('alter table "users" add constraint "users_parent_id_foreign" foreign key ("parent_id") references "parents" ("id") on delete cascade deferrable initially deferred', $statements[0]);
}

/**
* @expectedException \RuntimeException
* @expectedExceptionMessage The database driver in use does not support the Geometry spatial column type.
*/
public function testAddingGeometry()
{
$blueprint = new Blueprint('geo');
$blueprint->geometry('coordinates');
$blueprint->toSql($this->getConnection(), $this->getGrammar());
$statements = $blueprint->toSql($this->getConnection(), $this->getGrammar());

$this->assertCount(1, $statements);
$this->assertEquals('alter table "geo" add column "coordinates" geography(geometry, 4326) not null', $statements[0]);
}

public function testAddingPoint()
Expand Down