Menu

#134 Fix Database-Structure of Priceclasses

Structure
accepted
None
8
2013-09-09
2013-09-09
No

The Structure of the table price_classes is fundamentally broken; Data-duplication and complicated Cross-References over the Table itself, also ColumnNames that are not descriptive enough or just not needed (well, at least it looks like it, needs further investigation...). Redesign and fix it for future programmers not to completely lose their mind.

Discussion

  • Mirek Hancl

    Mirek Hancl - 2013-09-09

    price_classes is a slippery slope....
    It's easy atm to query the price for a given priceclass ID and group ID.
    It looks duplicated because of the price class name.
    You could:

    • Create a new table with the price class names
    • Modify the price_classes to pricesUsergroups,
      but you'll see that the structure will remain the same.
      You need the ID, because pc_ID is not unique. Also GID, pc_ID and price are a must-see,
      so I think the structure of price_classes is ok, just correct the field names ;)
     
  • Pascal Ernst

    Pascal Ernst - 2013-09-09

    Well, the Priceclass-name looks duplicated because it is indeed duplicated :)
    The Query may be easy, but the pc_ID is just a no-go; Their job is to group multiple Priceclass-Values together. This can be easily done with an extra Table, and while indeed the design of the Priceclasses stay the same, the structure of the Tables is much more readable.
    At the moment it just is not normalized correctly.

     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB