Terrastories / terrastories

Terrastories is a geostorytelling application for mapping, managing and sharing place-based stories.
https://terrastories.app
MIT License
319 stars 157 forks source link

Erroneous range limit on longitude decimal in the Points schema #204

Closed rudokemper closed 5 years ago

rudokemper commented 5 years ago

Latitude goes from -90 to 90, but Longitude goes from -180 to 180. However, the current limit for the decimal type seems to be set at for 2 integers.

Trying to seed a point with the coordinate of the location of Ruby by the Bay (-122.537419, 37.832257) currently results in the following rake error:

ActiveRecord::RangeError: Mysql2::Error: Out of range value for column 'lng' at row 1: INSERT INTO `points` (`title`, `lng`, `lat`, `created_at`, `updated_at`, `region`, `place_id`) VALUES ('Ruby By The Bay 2019', -122.537419, 37.832257, '2019-03-08 00:10:11', '2019-03-08 00:10:11', 'California', 7)

rudokemper commented 5 years ago

The seed data in this branch has this issue: https://github.com/rubyforgood/terrastories/tree/170-terrastories-generic-content

rudokemper commented 5 years ago

The precision and scale for the lat and long types should be adjusted to a quantity optimal for coordinates, like 10/6.