
Multiple Repository migration and association issues
Reported by Carl Porth | January 8th, 2010 @ 02:27 PM
Running auto_migrate! with multiple repositories creates tables on incorrect repository.
Also, running cross repository queries uses tables from the wrong repositories.
This standalone script demonstrates these issues:
http://gist.github.com/272379
Comments and changes to this ticket
-
Carl Porth January 9th, 2010 @ 04:26 PM
I've added some specs for associations on a topic branch at http://github.com/badcarl/dm-core/tree/multiple_repos
My general strategy is to place each model in its own repository so all associations are run on multiple repositories. For simplicity, each repo is a different sqlite3 db which makes setup easy for the dev.
This introduces an issue with has n, :through as there currently doesn't exist a way to specify the :through model repository, so I added the option :through_repository.
Shared specs that don't pass are commented out with TODO tags added.
-
Dan Kubb (dkubb) February 5th, 2010 @ 03:28 AM
- State changed from new to confirmed
Some of the cross-repository query issues (like m:m across more than 1 repo) probably won't be solvable in the near term. See #925 for more info on that.
Other queries like 1:m, m:1 and 1:1 can probably be made to work since we don't really use joins for those, but rather use the key value in an explicit query on the target.
Do these specs actually pass? Perhaps we can discuss this next time we're both on IRC at the same time.
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »