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

2010-02-11 Thread Jasen Betts
On 2010-02-09, 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. can one image be several people? can one image be both event and location? > What is the best way to manage a

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

2010-02-10 Thread Justin Graf
On 2/9/2010 6:59 AM, 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 single 'image' table wi

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

2010-02-10 Thread Louis-David Mitterrand
On Tue, Feb 09, 2010 at 08:01:35AM -0700, Rob Sargent wrote: > 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 i

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

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

2010-02-08 Thread Louis-David Mitterrand
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 types while keeping referrential integrity (foreign ke