Skip to content

Commit

Permalink
Add nullableMorphs in migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
antonkomarev committed Dec 20, 2016
1 parent c04b00c commit f91dc5c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion migrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ Command | Description
`$table->mediumInteger('numbers');` | MEDIUMINT equivalent for the database.
`$table->mediumText('description');` | MEDIUMTEXT equivalent for the database.
`$table->morphs('taggable');` | Adds unsigned INTEGER `taggable_id` and STRING `taggable_type`.
`$table->nullableMorphs('taggable');` | Adds unsigned INTEGER `taggable_id` NULL and STRING `taggable_type` NULL.
`$table->nullableTimestamps();` | Same as `timestamps()`.
`$table->rememberToken();` | Adds `remember_token` as VARCHAR(100) NULL.
`$table->smallIncrements('id');` | Incrementing ID (primary key) using a "UNSIGNED SMALL INTEGER" equivalent.
Expand Down Expand Up @@ -295,7 +296,7 @@ We could also modify a column to be nullable:
$table->string('name', 50)->nullable()->change();
});

> {note} The following column types can not be "changed": char, double, enum, mediumInteger, timestamp, tinyInteger, ipAddress, json, jsonb, macAddress, mediumIncrements, morphs, nullableTimestamps, softDeletes, timeTz, timestampTz, timestamps, timestampsTz, unsignedMediumInteger, unsignedTinyInteger, uuid.
> {note} The following column types can not be "changed": char, double, enum, mediumInteger, timestamp, tinyInteger, ipAddress, json, jsonb, macAddress, mediumIncrements, morphs, nullableMorphs, nullableTimestamps, softDeletes, timeTz, timestampTz, timestamps, timestampsTz, unsignedMediumInteger, unsignedTinyInteger, uuid.
<a name="renaming-columns"></a>
#### Renaming Columns
Expand Down

0 comments on commit f91dc5c

Please sign in to comment.