On 1/2/06, Kim Ryan <[EMAIL PROTECTED]> wrote:
> Thanks, I agree creation of an id column is the best way to go, and it
> actually
> simplifies the table definitions. Will use this approach.
>
And you probably want to say "X might_have Y" rather than Y has_a X.
This is a one to one. Be aware that when you delete X it cascade
deletes Y so be aware of that in case that is not what you want. .
Also, at some point you may find that my relationship might_have_wc
(Might have with Contstraints) may be useful. It is almost a mighthave
with multiple keys. You can specify which is the foreign key column
in related table (might_have always uses the Pk for the table ) and
the values of any other column. For example , say that Y is "Address"
and X is "Customer" . And say Addreess has these fields --
"category", "is_active",
Then you could say:
Customer->might_have_wc( 'billing_address' => 'Address' =>
# constraints below used in search might_have' s internal search
{ category => "Billing", is_active => 1}
);
.
Customer->might_have_wc( 'shipping_address' => 'Address' =>
{ category => "Shipping", is_active => 1}
);
Email me if you are interested in this and I can email it to you. It
may be at www.cafes.net/peter
--
pjs
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
Maypole-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/maypole-users