Skip to content

Commit

Permalink
Fixed #29876 -- MySQL does not support SPATIAL fields in unique indices.
Browse files Browse the repository at this point in the history
  • Loading branch information
apollo13 committed Oct 22, 2018
1 parent c53af56 commit 4269648
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions django/contrib/gis/db/backends/mysql/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,8 @@ class DatabaseFeatures(BaseSpatialFeatures, MySQLDatabaseFeatures):
@cached_property
def supports_empty_geometry_collection(self):
return self.connection.mysql_version >= (5, 7, 5)

@cached_property
def supports_geometry_field_unique_index(self):
# Not supported in MySQL since https://dev.mysql.com/worklog/task/?id=11808
return self.connection.mysql_is_mariadb

This comment has been minimized.

Copy link
@orf

orf Oct 22, 2018

Contributor

Hmm, sorry that I'm late to look at this, but shouldn't this include a check for mysql versions before 8?

0 comments on commit 4269648

Please sign in to comment.