Skip to content

Commit ba51013

Browse files
committed
Fix docs incorrectly stating primary keys default to unsigned
The documentation claimed primary keys are unsigned by default, but the actual code defaults to signed. Unsigned primary keys require either passing 'signed' => false or enabling the Migrations.unsigned_primary_keys feature flag.
1 parent 428f653 commit ba51013

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

docs/en/index.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -841,6 +841,8 @@ pass them to the method::
841841
// This one with the "default" connection
842842
$migrate = $migrations->migrate(['connection' => 'default']);
843843

844+
.. _feature-flags:
845+
844846
Feature Flags
845847
=============
846848

docs/en/writing-migrations.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -550,13 +550,14 @@ collation MySQL, SqlServer the default collation for a table if different than
550550
row_format MySQL set the table row format
551551
engine MySQL define table engine *(defaults to ``InnoDB``)*
552552
collation MySQL define table collation *(defaults to ``utf8mb4_unicode_ci``)*
553-
signed MySQL whether the primary key is ``signed`` *(defaults to ``false``)*
553+
signed MySQL whether the primary key is ``signed`` *(defaults to ``true``)*
554554
limit MySQL set the maximum length for the primary key
555555
========== ================ ===========
556556

557-
By default, the primary key is ``unsigned``.
558-
To simply set it to be signed just pass ``signed`` option with a ``true``
559-
value::
557+
By default, the primary key is ``signed``.
558+
To set it to be unsigned, pass the ``signed`` option with a ``false``
559+
value, or enable the ``Migrations.unsigned_primary_keys`` feature flag
560+
(see :ref:`feature-flags`)::
560561

561562
<?php
562563

0 commit comments

Comments
 (0)