Hey Derek,
Does the Postgres still have the FK issue, or did the fix you made for
H2 fix the others?
On Jul 13, 10:24 pm, Derek Chen-Becker <
dchenbec...@gmail.com> wrote:
> The problem is that we're only checking the table that holds the FK, so the
> method called is important. For example, in my test app, I have two
> entities:
>
> DateItem
> StringItem
>
> StringItem has a "timestamp" field that references DateItem, but DateItem
> has no FK fields. Because DateItem holds no FK fields it doesn't even get
> checked.
>
> Derek
>
> On Tue, Jul 13, 2010 at 7:02 PM, Naftoli Gugenheim <
naftoli...@gmail.com>wrote:
>
> > All right! Thanks!
> > But could it still be an H2 bug?
> > Maybe I'm misunderstanding something, but given tables and fields (random
> > setup)
> > A (id, b_id, c_id)
> > B (id, c_id)
> > C (id, a_id)
> > what's the difference if call an API that gives us
> > A -> [A.b_id, A.c_id]
> > B -> [B.c_id]
> > C -> [C.a_id]
> > or one that gives us
> > A -> [C.a_id]
> > B -> [A.b_id]
> > C -> [A.c_id, B.c_id]
> > after all, shouldn't we have all the same FKs?
>
> > On Tue, Jul 13, 2010 at 11:47 AM, Derek Chen-Becker <
dchenbec...@gmail.com
> > > wrote:
>
> >> Actually, just testing on H2, changing to getImportedKeys fixes it without
> >> dealing with case.
>
> >> On Tue, Jul 13, 2010 at 9:36 AM, Derek Chen-Becker <
dchenbec...@gmail.com
> >> > wrote:
>
> >>> Argh. I checked PostgreSQL and it looks like Schemifier may be using the
> >>> wrong call to determine keys. From the API docs for getExportedKeys
> >>> (emphasis mine):
>
> >>> Retrieves a description of the foreign key columns that reference the *given
> >>> table's primary key columns* (the foreign keys exported by a table).
>
> >>> Compare that to getImportedKeys:
>
> >>> Retrieves a description of the primary key columns that are * referenced
> >>> by the given table's foreign key columns* (the primary keys imported by
> ...
>
> read more »