public function isPostGis2() { $version = $this->connection->executeQuery('SELECT PostGIS_Lib_Version()')->fetchColumn(); return version_compare($version, '2.0.0', '>='); }
public function onSchemaAlterTableRenameColumn(SchemaAlterTableRenameColumnEventArgs $args) { $column = $args->getColumn(); if (!$this->isSpatialColumnType($column)) { return; } if ($this->schemaManager->isPostGis2()) { return; } throw new \RuntimeException('Spatial columns cannot be renamed (Requested renaming column "' . $args->getOldColumnName() . '" to "' . $column->getName() . '" in table "' . $args->getTableDiff()->name . '")'); }