Skip to content

Commit d6e4487

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 e8d7b84 commit d6e4487

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
@@ -549,13 +549,14 @@ comment MySQL, Postgres set a text comment on the table
549549
collation MySQL, SqlServer set the table collation *(defaults to database collation)*
550550
row_format MySQL set the table row format
551551
engine MySQL define table engine *(defaults to ``InnoDB``)*
552-
signed MySQL whether the primary key is ``signed`` *(defaults to ``false``)*
552+
signed MySQL whether the primary key is ``signed`` *(defaults to ``true``)*
553553
limit MySQL set the maximum length for the primary key
554554
========== ================ ===========
555555

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

560561
<?php
561562

0 commit comments

Comments
 (0)