public function onSchemaIndexDefinition(SchemaIndexDefinitionEventArgs $args)
 {
     $index = $args->getTableIndex();
     $spatialIndexes = $this->schemaManager->listSpatialIndexes($args->getTable());
     if (!isset($spatialIndexes[$index['name']])) {
         return;
     }
     $spatialIndex = new Index($index['name'], $index['columns'], $index['unique'], $index['primary'], array_merge($index['flags'], array('SPATIAL')));
     $args->setIndex($spatialIndex)->preventDefault();
 }
예제 #2
0
 /**
  * @group postgis-2.x
  */
 public function testIsPostGis2OnPostGIS2x()
 {
     $schemaManager = new SchemaManager($this->_getConnection());
     $this->assertTrue($schemaManager->isPostGis2());
 }