From 4269648c0fe59a7edfa11f022f17cd251e9c49ca Mon Sep 17 00:00:00 2001 From: Florian Apolloner Date: Mon, 22 Oct 2018 13:36:48 +0200 Subject: [PATCH] Fixed #29876 -- MySQL does not support SPATIAL fields in unique indices. --- django/contrib/gis/db/backends/mysql/features.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/django/contrib/gis/db/backends/mysql/features.py b/django/contrib/gis/db/backends/mysql/features.py index 16e8100b44..b69fd374fe 100644 --- a/django/contrib/gis/db/backends/mysql/features.py +++ b/django/contrib/gis/db/backends/mysql/features.py @@ -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