From d6e44876f9d965af74ac0136a4ac3bb24bfe9072 Mon Sep 17 00:00:00 2001 From: mscherer Date: Thu, 29 Jan 2026 05:18:23 +0100 Subject: [PATCH 1/2] 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. --- docs/en/index.rst | 2 ++ docs/en/writing-migrations.rst | 9 +++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/en/index.rst b/docs/en/index.rst index 7936f48a..ecbf72c7 100644 --- a/docs/en/index.rst +++ b/docs/en/index.rst @@ -841,6 +841,8 @@ pass them to the method:: // This one with the "default" connection $migrate = $migrations->migrate(['connection' => 'default']); +.. _feature-flags: + Feature Flags ============= diff --git a/docs/en/writing-migrations.rst b/docs/en/writing-migrations.rst index 4272fbc1..9b493837 100644 --- a/docs/en/writing-migrations.rst +++ b/docs/en/writing-migrations.rst @@ -549,13 +549,14 @@ comment MySQL, Postgres set a text comment on the table collation MySQL, SqlServer set the table collation *(defaults to database collation)* row_format MySQL set the table row format engine MySQL define table engine *(defaults to ``InnoDB``)* -signed MySQL whether the primary key is ``signed`` *(defaults to ``false``)* +signed MySQL whether the primary key is ``signed`` *(defaults to ``true``)* limit MySQL set the maximum length for the primary key ========== ================ =========== -By default, the primary key is ``unsigned``. -To simply set it to be signed just pass ``signed`` option with a ``true`` -value:: +By default, the primary key is ``signed``. +To set it to be unsigned, pass the ``signed`` option with a ``false`` +value, or enable the ``Migrations.unsigned_primary_keys`` feature flag +(see :ref:`feature-flags`):: Date: Thu, 29 Jan 2026 06:35:03 +0100 Subject: [PATCH 2/2] Mention unsigned_ints flag alongside unsigned_primary_keys Both flags should be used together so foreign key columns match the unsigned primary keys they reference. --- docs/en/writing-migrations.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/en/writing-migrations.rst b/docs/en/writing-migrations.rst index 9b493837..6da4195d 100644 --- a/docs/en/writing-migrations.rst +++ b/docs/en/writing-migrations.rst @@ -555,8 +555,10 @@ limit MySQL set the maximum length for the primary key By default, the primary key is ``signed``. To set it to be unsigned, pass the ``signed`` option with a ``false`` -value, or enable the ``Migrations.unsigned_primary_keys`` feature flag -(see :ref:`feature-flags`):: +value, or enable the ``Migrations.unsigned_primary_keys`` and +``Migrations.unsigned_ints`` feature flags (see :ref:`feature-flags`). +Both flags should be used together so that foreign key columns match +the primary keys they reference::