Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is the Doctrine Migrations project compatible with Doctrine MongoDB?

Is the Doctrine Migrations project compatible with Doctrine MongoDB?

It isn't clear to me from searching and looking at the Doctrine Migrations project whether it is compatible with ODM solutions (e.g. MongoDB) as well as ORM solutions.

If it is, can anyone suggest examples or articles on how to use the two together?

If it isn't, are there reasonable alternatives?


Question Background:

I understand, marginally, the different approaches to migrating a document's data from one version of the document to another and the pros and cons of each.

I am leaning towards possibly implementing a hybrid approach of gradual schema changes and migration scripts as suggested here. Leveraging the functionality within Doctrine's MongoDB library written about by Jonathan Wage in his post: Doctrine MongoDB ODM Schema Migrations.

Even with that, I need to find some way of creating a migration script or performing the data migration, and Doctrine Migrations seemed like a good first choice.

As an aside, another user warns against using the approach Jonathan Wage presents above for migrating data and instead running commands (JavaScript?) directly against the database.

like image 616
Sean Quinn Avatar asked Nov 02 '22 08:11

Sean Quinn


1 Answers

Despite doctrine-migrations is not compabible with MongoDB ODM (it only supports DBAL) you can bet for the alternative mongo-based migration components made by 3rd party teams.

It was firstly developed here https://github.com/antimattr/mongodb-migrations but after it has been abandoned the project continues here https://github.com/doesntmattr/mongodb-migrations

like image 66
manuelbcd Avatar answered Nov 09 '22 11:11

manuelbcd