public function onSchemaAlterTableAddColumn(SchemaAlterTableAddColumnEventArgs $args)
{
$column = $args->getColumn();
if (!$this->isSpatialColumnType($column)) {
return;
}
if ('geometry' !== $column->getType()->getName() || $this->schemaManager->isPostGis2()) {
return;
}
$diff = $args->getTableDiff();
$table = false !== $diff->newName ? $diff->newName : $diff->name;
$spatialColumnSqlGenerator = new SpatialColumnSqlGenerator($args->getPlatform());
$args->addSql($spatialColumnSqlGenerator->getSql($column, $table))->preventDefault();
}