From cd67572e427e682222f0d67f784392cd4ea9e461 Mon Sep 17 00:00:00 2001 From: Gwendolen Lynch Date: Fri, 8 Mar 2024 12:12:00 +0100 Subject: [PATCH] Check platform option exists before use --- src/Driver/PostGISPlatform.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Driver/PostGISPlatform.php b/src/Driver/PostGISPlatform.php index c417b03f..83e418f8 100644 --- a/src/Driver/PostGISPlatform.php +++ b/src/Driver/PostGISPlatform.php @@ -124,6 +124,9 @@ public function getAlterTableSQL(TableDiff $diff): array /** @var ColumnDiff $columnDiff */ foreach ($diff->getModifiedColumns() as $columnDiff) { + if(!$columnDiff->getOldColumn()->hasPlatformOption('srid') && !$columnDiff->getNewColumn()->hasPlatformOption('srid')) { + continue; + } if ($columnDiff->getOldColumn()->getPlatformOption('srid') !== $columnDiff->getNewColumn()->getPlatformOption('srid')) { $sql[] = sprintf( "SELECT UpdateGeometrySRID('%s', '%s', %d)",