Skip to content
Merged
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
4 changes: 3 additions & 1 deletion migrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ Before modifying a column, be sure to add the `doctrine/dbal` dependency to your

#### Updating Column Attributes

The `change` method allows you to modify an existing column to a new type or modify the column's attributes. For example, you may wish to increase the size of a string column. To see the `change` method in action, let's increase the size of the `name` column from 25 to 50:
The `change` method allows you to modify some existing column types to a new type or modify the column's attributes. For example, you may wish to increase the size of a string column. To see the `change` method in action, let's increase the size of the `name` column from 25 to 50:

Schema::table('users', function ($table) {
$table->string('name', 50)->change();
Expand All @@ -294,6 +294,8 @@ We could also modify a column to be nullable:
Schema::table('users', function ($table) {
$table->string('name', 50)->nullable()->change();
});

> {note} These column types can _NOT_ be changed in this way: `char, double, enum, mediumInteger, timestamp, tinyInteger, ipAddress, json, jsonb, macAddress, mediumIncrements, morphs, nullableTimestamps, softDeletes, timeTz, timestampTz, timestamps, timestampsTz, unsignedMediumInteger, unsignedTinyInteger, uuid`.

> {note} Modifying any column in a table that also has a column of type `enum` is not currently supported.

Expand Down