I am able to get the data migrated, but it is step 3 that I am trying
to find the most correct but direct method (using Doctrine
migrations).

The issue with the example at
http://www.doctrine-project.org/documentation/cookbook/1_0/en/symfony-and-doctrine-migrations
is that it requires the models to be updated twice, once before the
migration and again after the migration.  This does not seem to work
well for a distributed team, nor for deployment to production systems
as the upgrade is then a two step (two installed packages) upgrade
instead of a single testable and deployable package.

My current method is to use Doctrine_Manager::connection()->getDbh()
and then use PDO to migrate the data using standard SQL which then
doesn't need the old version of the model classes, but I was wondering
if there was a more "proper" way to do it via Doctrine or if there is
no direct support for this type of migration (yet).  The other option
I was looking at was copying the old model to a new class (uniquely
named by the version) and using that during the migration, but that
seemed unclean as well.


David
--
On Dec 26, 3:10 pm, Alexandre Salomé <[email protected]>
wrote:
> Your steps for the migration :
>
>    - Create the new table with your DocumentState class
>    - Add a new column "state_id" for your foreign key
>    - Foreach instance, find/create a state object and associate it.
>    - Delete your state_ columns
>
> Is it OK ?

--

You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en.


Reply via email to