You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
we will break the php migration, because Doctrine will query the database as
SELECT t0.content AS content, t0.created_at AS created_at -- ...
but the newly added column was not yet added to database when the php migration executes.
In other words, php migrations use latest meta data with Doctrine, because the model itself is not versioned (or at least the versions are not used for migration purposes).
I don't have a solution to propose, other than not using default Doctrine queries in php migrations. Even writing custom DQL/SQL queries cannot handle renamed columns etc.
The text was updated successfully, but these errors were encountered:
Yes, this is a well known limitation. The only solution I know was proposed by @PetrP and that is to essentially checkout old PHP files from Git repository.
Initial state:
php migration (
2016-01-01.php
)If we ever change the original model, for example by adding additional property
we will break the php migration, because Doctrine will query the database as
but the newly added column was not yet added to database when the php migration executes.
In other words, php migrations use latest meta data with Doctrine, because the model itself is not versioned (or at least the versions are not used for migration purposes).
I don't have a solution to propose, other than not using default Doctrine queries in php migrations. Even writing custom DQL/SQL queries cannot handle renamed columns etc.
The text was updated successfully, but these errors were encountered: