Doctrine ORM and External Databases

Permalink
I am developing a package that uses an external MySQL database, by which I mean it's a separate database to concrete5. It's a legacy database that still has an active application running on it. I have set up application/config/database.php so that it includes the database definition, and created several model classes for various tables, using ORM markup to avoid writing lots of unnecessary code. Mostly this is fine - I can read and write from the external database without error, by ensuring that my database object points at the external one.

However, running a package update, or refreshing the database entities results in an exception, claiming a table already exists in the concrete5 database, when it does not, nor should it. It does in fact exist in the external one.

It seems to me that there's an inconsistency here since it's clearly testing the concrete5 database, and then trying to create the database in the external one and throwing an exception citing the concreet5 database.

I don't have any db.xml files, so it must be doctrine code that's doing this. I'd rather it didn't do anything with regard to schema updates etc, so I wonder if anyone knows how to disable that part of the package update and entity refresh?

The error is similar to this:
The table with name 'shiny_new_db.oldtable' already exists.

jero
View Replies: