Migrations refreshed each time with capped length indexes on MySQL #7522

Open
opened 2026-01-22 15:52:53 +01:00 by admin · 0 comments
Owner

Originally created by @maciekpaprocki on GitHub (Jun 18, 2025).

Bug Report

Version

"doctrine/doctrine-bundle": "^2.14",
"doctrine/doctrine-migrations-bundle": "^3.4",
"doctrine/orm": "^3.4",

Summary

When running php bin/console doctrine:migrations:diff --no-interaction indexes are refreshed every time even when just applied. Issue is only happening when specifing index length

#[ORM\Index(name: 'url_idx', fields: ['url'], options: ['lengths' => ['url' => 255]])]

Current behavior

Index is added to migration every time i run diff

Expected behavior

It should be only added first time

How to reproduce

It's a pretty barebones project, so probably just adding index with fixed length should do.

Originally created by @maciekpaprocki on GitHub (Jun 18, 2025). ### Bug Report Version ``` "doctrine/doctrine-bundle": "^2.14", "doctrine/doctrine-migrations-bundle": "^3.4", "doctrine/orm": "^3.4", ``` #### Summary When running `php bin/console doctrine:migrations:diff --no-interaction` indexes are refreshed every time even when just applied. Issue is only happening when specifing index length ``` #[ORM\Index(name: 'url_idx', fields: ['url'], options: ['lengths' => ['url' => 255]])] ``` #### Current behavior Index is added to migration every time i run diff #### Expected behavior It should be only added first time #### How to reproduce It's a pretty barebones project, so probably just adding index with fixed length should do.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#7522