@@ -130,6 +130,40 @@ insertOrSkip() for Seeds
130130New ``insertOrSkip() `` method for seeds to insert records only if they don't already exist,
131131making seeds more idempotent.
132132
133+ Foreign Key Constraint Naming
134+ =============================
135+
136+ Starting in 5.x, when you use ``addForeignKey() `` without providing an explicit constraint
137+ name, migrations will auto-generate a name using the pattern ``{table}_{columns} ``.
138+
139+ Previously, MySQL would auto-generate constraint names (like ``articles_ibfk_1 ``), while
140+ PostgreSQL and SQL Server used migrations-generated names. Now all adapters use the same
141+ consistent naming pattern.
142+
143+ **Impact on existing migrations: **
144+
145+ If you have existing migrations that use ``addForeignKey() `` without explicit names, and
146+ later migrations that reference those constraints by name (e.g., in ``dropForeignKey() ``),
147+ the generated names may differ between old and new migrations. This could cause
148+ ``dropForeignKey() `` to fail if it's looking for a name that doesn't exist.
149+
150+ **Recommendations: **
151+
152+ 1. For new migrations, you can rely on auto-generated names or provide explicit names
153+ 2. If you have rollback issues with existing migrations, you may need to update them
154+ to use explicit constraint names
155+ 3. The auto-generated names include conflict resolution - if ``{table}_{columns} `` already
156+ exists, a counter suffix is added (``_2 ``, ``_3 ``, etc.)
157+
158+ **Name length limits: **
159+
160+ Auto-generated names are truncated to respect database limits:
161+
162+ - MySQL: 61 characters (64 - 3 for counter suffix)
163+ - PostgreSQL: 60 characters (63 - 3)
164+ - SQL Server: 125 characters (128 - 3)
165+ - SQLite: No limit
166+
133167Migration File Compatibility
134168============================
135169
0 commit comments