Re: Another FK puzzle; generation order dependency?

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Sat Dec 20 2003 - 00:00:58 EST

  • Next message: Jim Menard: "Random selection"

    On Dec 18, 2003, at 3:31 PM, Jim Menard wrote:

    > Schema Generation Error: Failed statement: ALTER TABLE public.photo
    > ADD FOREIGN KEY (id) REFERENCES public.album (cover_photo_id) - ERROR:
    > UNIQUE constraint matching given keys for refenced table "album" not
    > found.

    Jim,

    this seems no different from your previous error - a to-one
    relationship pointing to an FK ("cover_photo_id" is not a PK of
    "album"). I have a bug report for that:
    http://objectstyle.org/jira/secure/ViewIssue.jspa?key=CAY-63 . When
    fixed, Cayenne should handle this more transparently. For now map it as
    a "to-many".

    Andrus



    This archive was generated by hypermail 2.0.0 : Sat Dec 20 2003 - 00:01:03 EST