You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (!in_array($attributeType, [self::VAR_POINT, self::VAR_LINESTRING, self::VAR_POLYGON])) {
3229
-
thrownewDatabaseException('Spatial index can only be created on spatial attributes (point, linestring, polygon). Attribute "' . $attr . '" is of type "' . $attributeType . '"');
3329
+
thrownewIndexException('Spatial index can only be created on spatial attributes (point, linestring, polygon). Attribute "' . $attr . '" is of type "' . $attributeType . '"');
3230
3330
}
3231
3331
}
3232
3332
@@ -4640,7 +4740,6 @@ public function updateDocuments(
4640
4740
if (!is_null($this->timestamp) && $oldUpdatedAt > $this->timestamp) {
4641
4741
thrownewConflictException('Document was updated after the request timestamp');
if (!\in_array($attributeType, Database::SPATIAL_TYPES, true)) {
359
-
$this->message = 'Spatial index can only be created on spatial attributes (point, linestring, polygon). Attribute "' . $attributeName . '" is of type "' . $attributeType . '"';
351
+
continue;
352
+
}
353
+
354
+
if (!$this->spatialIndexSupport) {
355
+
$this->message = 'Spatial indexes are not supported';
360
356
returnfalse;
361
357
}
362
358
359
+
if (count($attributes) !== 1) {
360
+
$this->message = 'Spatial index can be created on a single spatial attribute';
361
+
returnfalse;
362
+
}
363
+
364
+
if ($type !== Database::INDEX_SPATIAL) {
365
+
$this->message = 'Spatial index can only be created on spatial attributes (point, linestring, polygon). Attribute "' . $attributeName . '" is of type "' . $attributeType . '"';
if (!$required && !$this->spatialIndexNullSupport) {
365
370
$this->message = 'Spatial indexes do not allow null values. Mark the attribute "' . $attributeName . '" as required or create the index on a column with no null values.';
366
371
returnfalse;
367
372
}
368
-
}
369
373
370
-
if (!empty($orders) && !$this->spatialIndexOrderSupport) {
371
-
$this->message = 'Spatial indexes with explicit orders are not supported. Remove the orders to create this index.';
372
-
returnfalse;
374
+
if (!empty($orders) && !$this->spatialIndexOrderSupport) {
375
+
$this->message = 'Spatial indexes with explicit orders are not supported. Remove the orders to create this index.';
0 commit comments