MikeMurko
MikeMurko

Reputation: 2233

Doctrine2 SQL Server Mapping Generation

I have a large (100+ tables) SQL Server 2005 database that I would like to start mapping with Doctrine. Right now I've done a manual job of a few tables (no relations yet, just disparate tables), using PHPDOC annotation mapping inside my entities. Manually it works like a charm ... however it really will take ages to get everything mapped out and I'm looking for an easier way.

I looked into ORM Designer, but it doesn't seem to offer imports from a SQL Server database. I also looked at using Doctrine CLI and doing the "reverse engineering" mentioned here. Finally tried using orm:convert-mapping --from-database with no luck. It appears the last two are conditional on the fact that the sqlsrv drivers (running on IIS7 here) cause an error on my tables when they have no index: PDOException: The active result for the query contains no fields.

Is it possible that I can load up Doctrine on an Ubuntu machine, and use whatever drivers Linux has to connect to SQL Server 2005 ... then perhaps the orm:convert-mapping feature wouldn't die on me?

Any help would be much appreciated!

Upvotes: 0

Views: 1021

Answers (1)

Cristian Douce
Cristian Douce

Reputation: 3208

Try with this drivers for php. (clue: non thread safe)

Also check your connection parameters.

I worked on a SQLServer 2005 express project with Symfony2 and I mapped all my tables in reverse with no trouble at all.

Well, actually had to implement a new doctrine type for datetime as it says here.

Good luck!

Upvotes: 1

Related Questions