コード例 #1
0
 public function testDisablePostgis()
 {
     $blueprint = new Blueprint('test');
     $blueprint->disablePostgis();
     $statements = $blueprint->toSql($this->getConnection(), $this->getGrammar());
     $this->assertEquals(1, count($statements));
     $this->assertContains('DROP EXTENSION postgis', $statements[0]);
 }
コード例 #2
0
 /**
  * Adds a statement to add a geometry column
  *
  * @param Blueprint $blueprint
  * @param Fluent $command
  * @return string
  */
 protected function compileGeometry(Blueprint $blueprint, Fluent $command)
 {
     $dimensions = $command->dimensions ?: 2;
     $typmod = $command->typmod ? 'true' : 'false';
     $srid = $command->srid ?: 4326;
     return sprintf("SELECT AddGeometryColumn('%s', '%s', %d, '%s', %d, %s)", $blueprint->getTable(), $command->column, $srid, strtoupper($command->type), $dimensions, $typmod);
 }