Re: Is it suitable using STI?

Mauro
Thu, 10 May 2012 15:26:55 -0000

On 10 May 2012 17:05, Greg Akins
<angrygreg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:
>
>
> On Thu, May 10, 2012 at 10:57 AM, Mauro
<mrsanna1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>>
>> I have problems on a simple design problem.
>> I have many companies. Each company have one or more commercial
activity.
>> Activities types are: ecommerce, local unit, television, automatic
>> vending machines, and so on.
>
>
> So can each Company have many CommercialActivities
>
> Then.. CommercialActivity is STI, which means it has a type column and
> sub-types can be ECommerceActivity, TelevisionActivity, etc..
>
> The only warning is that if each type is dramatically different, you might
> want to investigate doing it with multiple tables so you dont have a lot of
> redundant fields trying model things with additional attributes that
aren''t
> shared.

Yes the problem is that television, ecommerce, etc. they don''t share
the same attributes.