[Chicago-talk] modeling bridge tables

jason at multiply.org jason at multiply.org
Tue Sep 28 10:06:42 CDT 2004


Why complicate it?

If you can have a many to many as a common scenario, skip the local storage of a
1->n (the building_id in company, in your example).

Use something like this:
--------------------------

Company Table
+----------------------+
|  company_id          |
|   ...others          |
+----------------------+


Building Table
+----------------------+
|  building_id         |
|   ...others          |
+----------------------+


company_to_building table
+----------------------+
|  company_id          |
|  building_id         |
|   ...others          |
+----------------------+

don't overcomplicate it.  From a company_to_building table, you have access to
the building and company objects without muddying their details and
functionality.

-jason gessner
    jason at multiply.org


----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.


More information about the Chicago-talk mailing list