Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/en/appendices/5-5-migration-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ Coming soon

### Database

- MySQL `string`, `char`, `text` and `uuid` columns now support a `charset`
option. See [MySQL Column Character Sets](../orm/schema-system#mysql-column-character-sets).

- `Cake\Database\Expression\JsonPathExpression` was added. This expression
object provides a fluent interface for defining JSON path expressions.

Expand Down
22 changes: 22 additions & 0 deletions docs/en/orm/schema-system.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,28 @@ $c = $schema->column('title');
$cols = $schema->columns();
```

### MySQL Column Character Sets

::: info Added in version 5.5.0
:::

On MySQL, `string`, `char`, `text` and `uuid` columns accept a `charset` option
in addition to `collate`. This allows a column to use a different character set
from the table default:

```php
$schema->addColumn('external_id', [
'type' => 'string',
'length' => 64,
'charset' => 'ascii',
'collate' => 'ascii_bin',
]);
```

The generated column definition includes `CHARACTER SET ascii COLLATE ascii_bin`.
Choose a collation belonging to the selected character set. Schema reflection
reports the column's collation but does not infer its `charset` value.

### Indexes and Constraints

Indexes are added using the `addIndex()`. Constraints are added using
Expand Down
Loading