Skip to content

Commit

Permalink
adds default SRID to spatial columns to ensure MySQL 8 is able to use
Browse files Browse the repository at this point in the history
spatial indexes
  • Loading branch information
dpfens committed Mar 25, 2022
1 parent 8818e62 commit 7288e46
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions geonames_spatial.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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);

0 comments on commit 7288e46

Please sign in to comment.