Why component_a, _b, _c... You will end up create new table all the time...
Richard On Thu, Sep 11, 2014 at 7:04 AM, Jan Beilicke <[email protected]> wrote: > Hi everyone, > > I'm working on a web2py project which requires a complex relationship > model. I want to use a model that works well with web2py's DAL and I would > be glad if somebody could point me into the right direction. > > I created a small sample ER diagram to illustrate my problem, only the > important parts are displayed and the table names are generalized for > easier understanding. The database has a couple of tables (or business > objects), most of them are depending on some supertype, let's call it > 'component_type', the subtypes 'component_[a-z]'. > > The business case requires to create a component_package which contains > required components, but *all components in the package must be of the > same component_type.* > > Two possible variants are shown in the illustration: > > Variant A: The component_package contains the foreign keys of the > component tables. > Variant B: The package additionally contains the foreign key of the > component_type table. > > Which variant would you recommend and which one might work better with > DAL? Unfortunately, all the resources and database design documents I found > in the web were only explaining the general supertype/subtype relation. > > Thank you in advance and > kind regards, > > Jan > > > <https://lh3.googleusercontent.com/-zgZdMMjkmwg/VBF_6_5O2FI/AAAAAAAAAYc/PXyEaTB32iQ/s1600/relation_problem.png> > > -- > Resources: > - http://web2py.com > - http://web2py.com/book (Documentation) > - http://github.com/web2py/web2py (Source code) > - https://code.google.com/p/web2py/issues/list (Report Issues) > --- > You received this message because you are subscribed to the Google Groups > "web2py-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.

