OK. descriptions of tables are below.

Both Users and Sessions are referenced by Sessions_Metadata

Class::DBI doc says has_many is used to declare that another table is referencing us, so both Users and Sessions need a has_many(sessions_metadata)?

I tried this in sessions:

__PACKAGE__->has_many( sessions_metadata=>['EP::Common::DBI::Sessions_M +etadata' => 'session_id' ] => 'id' );
(and equiv in users) which I was hoping meant that 'session_id' is an FK in Sessions_Metadata which refers to 'id': the PK in sessions.
Still get the same error.
have I got the wrong end of the stick?
sessions_metadata Column | Type | Modifiers -------------+------------------------+----------- session_id | character(32) | not null username | character varying(40) | create_date | character varying(100) | expire | character varying(100) | query_id | character varying(50) | Indexes: sessions_metadata_pkey primary key btree (session_id) Foreign Key constraints: $1 FOREIGN KEY (session_id) REFERENCES sessio +ns(id) ON UPDATE NO ACTION ON DELETE NO ACTION, $2 FOREIGN KEY (username) REFERENCES users(us +ername) ON UPDATE NO ACTION ON DELETE NO ACTION sessions Column | Type | Modifiers -----------+---------------+----------- id | character(32) | not null a_session | text | Indexes: sessions_pkey primary key btree (id) users Column | Type | Modifiers --------------+------------------------+-------------------- username | character varying(40) | not null password | character varying(40) | not null salt | smallint | not null session_only | smallint | not null default 0 first_name | character varying(40) | not null last_name | character varying(40) | not null institute | character varying(255) | department | character varying(255) | address | character varying(255) | telephone | character varying(255) | email | character varying(100) | not null Indexes: users_pkey primary key btree (username)

In reply to Re: 3Re: Class::DBI has_a relationships by CassJ
in thread Class::DBI has_a relationships by CassJ

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.