Re: [SQL] 'image' table with relationships to different objects

2010-02-09 Thread Rob Sargent
You can also invert this, making all the image owner share a common base table and then images are dependent on that base base (id, type) where type is an enumeration or some such person (id, name, etc) where id is FK to base id locations (id, address, etc) where id is FK to base.id events(id, dat

Re: [SQL] 'image' table with relationships to different objects

2010-02-09 Thread Louis-David Mitterrand
On Tue, Feb 09, 2010 at 11:59:14AM +, Richard Huxton wrote: > On 09/02/10 07:49, Louis-David Mitterrand wrote: > >Hello, > > > >In my database I have different object types (person, location, event, > >etc.) all of which can have several images attached. > > > >What is the best way to manage a

Re: [SQL] 'image' table with relationships to different objects

2010-02-09 Thread Richard Huxton
On 09/02/10 07:49, Louis-David Mitterrand wrote: Hello, In my database I have different object types (person, location, event, etc.) all of which can have several images attached. What is the best way to manage a single 'image' table with relationships to (potentially) many different object typ

Re: [SQL] 'image' table with relationships to different objects

2010-02-09 Thread Michael Lourant
Hi There, Maybe a table MEDIA_OBJECT with a ID column that will be exported as FK to other tables and as many columns as media types you want to store or a single column where you'll store the bytes of your media file. Hope it works! __ Michael Lourant "Let's warm them all..." 2010/2/9 Louis-D