Is the Doctrine Migrations project compatible with Doctrine MongoDB?

2.9k views Asked by At

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.

2

There are 2 answers

0
Serhii Smirnov On

Ufortunately, it isn't compatible with ODM. It supports ORM only.

3
manuelbcd On

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