On Tue, 23 Nov 2004 10:02:24 -0500, Seth Gordon wrote
> A while ago, I set up a PostgreSQL database and a few scripts for
> maintaining our home library
>
> (http://dynamic.ropine.com/jeeves/library/). I'd like to convert
> this to a Maypole application so I can add more features to the
> system without typing oodles of raw SQL. The first time I tried
> this (with Maypole 1.7), I got errors about some of the tables not
> having primary keys. (The tables in question were only being used
> for joins in many-to-many operations, so I had not bothered giving
> them primary keys in setting up the schema.) Also, the table and
> column names don't match the pattern shown in the beer DB: instead
> of having a "title" table with an "id" field, I have a "titles"
> table with a "title_id" field.
Are you using Class::DBI::Loader::Relationship? You don't have to - you can
use Class::DBI's methods to define the table relationships.
> Before I try this again with the latest version of Maypole, I'd like
> to know what I need to do with the schema to make it acceptable, and
> what special configuration commands I need in my application module
> to explain my naming conventions to Maypole. (I see there's some
> stuff in Class::DBI for defining how column names are translated to
> object properties, but I'm not sure how Maypole interacts with that
> part of Class::DBI.)
By default, Maypole uses Class::DBI::Loader to bring all the table classes
into existance. Or, if you so desire, you can manually define your table
classes and relationships in the usual Class::DBI way. It's pretty flexible.
If your columns are aren't what CDBI::Loader::Relationship is expecting, then
try setting up the table relationships manually with Class::DBI. Take a look
at the value of @{__PACKAGE__->config->{classes}} to see what classes have
been loaded for you.
HTH
--simonflk
_______________________________________________
maypole mailing list
maypole at lists.netthink.co.uk
http://lists.netthink.co.uk/listinfo/maypole
This archive was generated by hypermail 2.1.3 : Thu Feb 24 2005 - 22:25:57 GMT