Skip to content

Commit bd96af2

Browse files
committed
Merge branch '5.4' into 5.5
2 parents 24e93d5 + 4f27948 commit bd96af2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

docs/package/database-php-api.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ If it is not present, `DatabaseTable::foreignKeys()` will automatically set one
123123
Indices are represented by `DatabaseTableIndex` objects:
124124

125125
```php
126-
DatabaseTableIndex::create()
126+
DatabaseTableIndex::create('fooID')
127127
->type(DatabaseTableIndex::UNIQUE_TYPE)
128128
->columns(['fooID'])
129129
```
@@ -132,5 +132,6 @@ There are four different types: `DatabaseTableIndex::DEFAULT_TYPE` (default), `D
132132
For primary keys, there is also the `DatabaseTablePrimaryIndex` class which automatically sets the type to `DatabaseTableIndex::PRIMARY_TYPE`.
133133
To drop a index, all of the relevant data to create the index has to be present and the `drop()` method has to be called.
134134

135-
`DatabaseTableIndex::create()` also supports the index name as a parameter.
136-
If it is not present, `DatabaseTable::indices()` will automatically set one based on the index data.
135+
The index name is specified as the parameter to `DatabaseTableIndex::create()`.
136+
It is strongly recommended to specify an explicit name ([WoltLab/WCF#4505](https://github.com/WoltLab/WCF/issues/4505)).
137+
If no name is given, `DatabaseTable::indices()` will automatically set one based on the index data.

0 commit comments

Comments
 (0)