From 7288e4636e087cdc1139973867c4c9924e2c5baf Mon Sep 17 00:00:00 2001 From: Doug Fenstermacher Date: Fri, 25 Mar 2022 10:37:14 -0400 Subject: [PATCH] adds default SRID to spatial columns to ensure MySQL 8 is able to use spatial indexes --- geonames_spatial.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/geonames_spatial.sql b/geonames_spatial.sql index 510aba0..147704a 100644 --- a/geonames_spatial.sql +++ b/geonames_spatial.sql @@ -2,14 +2,14 @@ USE geonames; CREATE TABLE geoNameSpatial ( `geonameid` INT UNSIGNED PRIMARY KEY COMMENT "Integer id of record in geonames database", - `coordinates` POINT NOT NULL COMMENT "Latitude-Longitude coordinates of record" + `coordinates` POINT NOT NULL SRID 4326 COMMENT "Latitude-Longitude coordinates of record" ) ROW_FORMAT=COMPRESSED; CREATE SPATIAL INDEX sx_geonames_coords ON geoNameSpatial(coordinates); CREATE TABLE `shapesSpatial` ( `geonameid` INT UNSIGNED PRIMARY KEY COMMENT "Integer id of record in geonames database", - `geom` GEOMETRY NOT NULL + `geom` GEOMETRY NOT NULL SRID 4326 ) ROW_FORMAT=COMPRESSED; CREATE SPATIAL INDEX sx_shapes_geom ON shapesSpatial(geom);