diff --git a/docs/en/02_Developer_Guides/00_Model/12_Indexes.md b/docs/en/02_Developer_Guides/00_Model/12_Indexes.md
index 673dde74f..e517e74f9 100644
--- a/docs/en/02_Developer_Guides/00_Model/12_Indexes.md
+++ b/docs/en/02_Developer_Guides/00_Model/12_Indexes.md
@@ -71,6 +71,11 @@ support the following:
}
```
+
+Please note that if you have previously used the removed `value` key to define an index's contents, SilverStripe will
+now throw an error. Use `columns` instead.
+
+
## Complex/Composite Indexes
For complex queries it may be necessary to define a complex or composite index on the supporting object. To create a
composite index, define the fields in the index order as a comma separated list.
diff --git a/docs/en/04_Changelogs/4.0.0.md b/docs/en/04_Changelogs/4.0.0.md
index c97240a52..61fb02836 100644
--- a/docs/en/04_Changelogs/4.0.0.md
+++ b/docs/en/04_Changelogs/4.0.0.md
@@ -1242,7 +1242,7 @@ use SilverStripe\ORM\DataObject;
*/
class MyStagedModel extends SilverStripe\ORM\DataObject
{
- private staic $extensions = [
+ private static $extensions = [
"SilverStripe\\ORM\\Versioning\\Versioned('StagedVersioned')"
];
}
@@ -1971,6 +1971,7 @@ A very small number of methods were chosen for deprecation, and will be removed
* `ChangeSet` and `ChangeSetItem` have been added for batch publishing of versioned dataobjects.
* `DataObject.table_name` config can now be used to customise the database table for any record.
* `DataObjectSchema` class added to assist with mapping between classes and tables.
+* `DataObject.indexes` now uses `columns` instead of `value` to define index contents.
* `DBMoney` values are now treated as empty only if `Amount` field is null. If an `Amount` value
is provided without a `Currency` specified, it will be formatted as per the current locale.
* Removed `DatabaseAdmin#clearAllData()`. Use `DB::get_conn()->clearAllData()` instead
diff --git a/src/ORM/Connect/DBSchemaManager.php b/src/ORM/Connect/DBSchemaManager.php
index cf3b8beab..d8f4a2789 100644
--- a/src/ORM/Connect/DBSchemaManager.php
+++ b/src/ORM/Connect/DBSchemaManager.php
@@ -558,8 +558,18 @@ abstract class DBSchemaManager
protected function convertIndexSpec($indexSpec)
{
// Return already converted spec
- if (!is_array($indexSpec) || !array_key_exists('type', $indexSpec) || !array_key_exists('columns', $indexSpec) || !is_array($indexSpec['columns'])) {
- throw new \InvalidArgumentException(sprintf('argument to convertIndexSpec must be correct indexSpec, %s given', var_export($indexSpec, true)));
+ if (!is_array($indexSpec)
+ || !array_key_exists('type', $indexSpec)
+ || !array_key_exists('columns', $indexSpec)
+ || !is_array($indexSpec['columns'])
+ || array_key_exists('value', $indexSpec)
+ ) {
+ throw new \InvalidArgumentException(
+ sprintf(
+ 'argument to convertIndexSpec must be correct indexSpec, %s given',
+ var_export($indexSpec, true)
+ )
+ );
}
// Combine elements into standard string format