On Thu, Oct 30, 2008 at 7:27 PM, Stephen Soltesz <[EMAIL PROTECTED]> wrote:
> I've attached a simple example where I'm attempting to auto load two tables > with a manytoone/onetomany relationship. In the given schema I'm working > with there is no constraint on the table. > > The code attached has a line that will modify the table to include a > constraint, and with it, everything works nicely. Without it, during > setup_all() create_keys throws the exception: > Exception: Couldn't find a foreign key constraint in table 'media' using the > following columns: userid. > > I'm wondering if there's a way to autoload these tables without modifying > this schema (it's not mine, after all :-)? No, it's not possible currently. The thing is, Elixir (nor SA) can't guess the primaryjoin when there is no FK, so you need to pass extra information there. Elixir will let you pass the extra info, but will fail anyway (I didn't think about this case when I wrote that part). Could you open a ticket for this in our trac? I'll fix this as soon as I get some time to work on Elixir. Hopefully tomorrow since it's an easy fix (but don't hold your breath). -- Gaƫtan de Menten http://openhex.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "SQLElixir" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlelixir?hl=en -~----------~----~----~----~------~----~------~--~---
