Replies: 11 comments 29 replies
-
Migration from Yaml to AttributesShared on X.
|
Beta Was this translation helpful? Give feedback.
-
On a personal level, the main issues I had to fix when migrating to ORM 3 were the following:
Overall, it wasn't "that hard", but it highly depends on the project. Friendly pinging @webmozart, @theofidry , I recall you had some difficulties on certain internal libs that you use, especially regarding the persistence of ID-objects? |
Beta Was this translation helpful? Give feedback.
-
Private mention of PostgreSQL Identifier Migration from SERIAL to autoincrement being complicated: https://www.doctrine-project.org/projects/doctrine-dbal/en/4.0/how-to/postgresql-identity-migration.html Others mention that they fixed this by moving to SEQUENCE strategy, which only requires:
Diff for changing to SEQUENCE, that produces a migration to remove the default. Benefit of this migration strategy: it allows rolling out the code without the migration and will work, and then you can do the migration in a second deployment:
|
Beta Was this translation helpful? Give feedback.
-
Currently, our main issue is the fact that this column type does not seem to work anymore. However, I haven't had the opportunity to dig into the issue, to find out which component is the exact source. So it might be possible to update the ORM package, since the error seems to be due to the version of the DBAL package (but I didn't check compatibility). #[ORM\Column(
name: 'tbk_source',
type: 'string',
enumType: SourceEnum::class,
columnDefinition: "ENUM('source_a', 'source_b', 'source_c', 'source_d') NOT NULL"
)]
protected SourceEnum $source= SourceEnum::SOURCE_A;
|
Beta Was this translation helpful? Give feedback.
-
@Nek- is blocked of upgrading because of this return type: Line 200 in 4f3a5c5 It causes an issue with prophecy: phpspec/prophecy#535 |
Beta Was this translation helpful? Give feedback.
-
For Doctrine ORM 3 only, the biggest single issue was the change of the flush behaviour (that it is no longer possible to flush single entities). To migrate with more confidence, that required us to implement a "guarded flush", which registers a listener just before the flush call to check that nothing unexpected (within reason – checking the exact expectation can be tricky for relationships) is flushed. The source code changes themselves were fine, getting the infra necessary to introduce those changes with confidence a lot less so. Maybe some of this infra could be ported to Doctrine ORM, not sure. The final result is pretty neat, but that required quite a few hacks to work around some of Doctrine internal caches. Doing so also highlighted an issue which is that value objects cannot be compared by equality. We had to introduce a listener to replace the references compared to not trigger unnecessary computation changes. I think you captured this in #5542. |
Beta Was this translation helpful? Give feedback.
-
We solved the removal of the array type by adding our own type.
Afterwards migrated to json field and duplicated the data in both until we
were ready to remove the old array field.
…On Wed, 8 Oct 2025 at 00:37, Théo FIDRY ***@***.***> wrote:
For Doctrine ORM 3 only, the biggest single issue was the change of the
flush behaviour (that it is no longer possible to flush single entities).
To migrate with more confidence, that required us to implement a "guarded
flush", which registers a listener just before the flush call to check that
nothing unexpected (within reason – checking the exact expectation can be
tricky for relationships) is flushed. The source code changes themselves
were fine, getting the infra necessary to introduce those changes with
confidence *a lot* less so. Maybe some of this infra could be ported to
Doctrine ORM, not sure. The final result is pretty neat, but that required
quite a few hacks to work around some of Doctrine internal caches.
Doing so also highlighted an issue which is that value objects cannot be
compared by equality. We had to introduce a listener to replace the
references compared to not trigger unnecessary computation changes. I think
you captured this in #5542 <#5542>.
—
Reply to this email directly, view it on GitHub
<#12193 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAEK3U2NA6AK4ILTMQGIO333WQ6B5AVCNFSM6AAAAACIQQENFKVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTINRSGAYTKNI>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I use XML mapping from beginning and the migration to v3 (with dbal 3 and then to dbal 4) was relatively easy. |
Beta Was this translation helpful? Give feedback.
-
I'm using ORM3, but I suspect this could be a blockers for some people, because now I'm constantly deleting additional lines from migration, since there are no longer comments in custom fields, it's harder to distinguish them for ORM if you want your own custom types that are already used by doctrine (for instance custom TinyInt type, it's already mapped to boolean and for some readon it has to have exactly same SQL definition). doctrine/migrations#1435, doctrine/dbal#6743 Also this is an annoying thing, when you use trait for ID, even at the start of entity class, the ID will be somewhere at random position surrounded by other columns, so when adding new tables there is some manual work of re-arranging the ID at the start of the table in migrations, this bug was introduced probably by DBAL 4.0 but I haven't had the time to debug it more deeply. |
Beta Was this translation helpful? Give feedback.
-
Currently we cant upgrade because of this:
It seems like there is a forgotton issue for the upgrade here: doctrine/DoctrineORMModule#752 |
Beta Was this translation helpful? Give feedback.
-
One of the major features we rely on is |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi!
we plan to phase out most maintenance of ORM 2 over the next year.
To help users we are trying to find out what is blocking everyone to upgrade to ORM 3 for now?
And if you have upgrade to ORM 3 already, what did you struggle with the most?
A few high level points that we changed since we first released and announced ORM 3.0:
AbstractQuery::toIterable
and scalar results [GH-9219] Add support for toIterable over mixed or scalar results. #12187 - so thatAbstractQuery::toIterable
is now a full replacement forAbstractQuery::iterate
.Let us know in the comments and we will occasionally distill all the comments and information here on top and linking to potential issues, and changes.
You can also write me to [email protected] with the subject "Doctrine ORM 3.0 Upgrade" if you want to remain anonymous or add more details that you don't want to post here.
Thank you for helping us help you make the migration to ORM 3 easier for everyone!
Beta Was this translation helpful? Give feedback.
All reactions