[Dbix-class] unsure about table setup - ideas needed

Matt S Trout dbix-class at trout.me.uk
Mon Sep 3 19:37:59 GMT 2007


On Sun, Aug 26, 2007 at 12:11:40AM +0200, Mario Minati wrote:
> Hello @all,
> 
> I need to create a database schema that can handle the following situation:
> 
> 1. a company has many branches
> 2. a branch has many addresses
> - for each branch address there is one additional dataset with shipping 
> information
> 3. a person has many addresses
> - for eachperson address there is one additional dataset with houseing 
> information
> 
> I would like to store the addresses in one table, as I would like to search 
> over one set of addresses.
> And I need the ability to reach the company/person object from the address 
> object.
> 
> How can I do this?

Address class contains just address info

BranchAddress belongs_to Address, belongs_to BranchAddress, PK address_id

ShippingInformation belongs_to BranchAddress

etc.

-- 
      Matt S Trout       Need help with your Catalyst or DBIx::Class project?
   Technical Director    Want a managed development or deployment platform?
 Shadowcat Systems Ltd.  Contact mst (at) shadowcatsystems.co.uk for a quote
http://chainsawblues.vox.com/                    http://www.shadowcat.co.uk/ 



More information about the DBIx-Class mailing list