Fixed #23731 -- Fixed migrations crash when adding blank GeometryFields on PostGIS.

Thanks raratiru for the report and Claude Paroz for review.