I have to design an application which will store products with default values, in a table called default_products
.
This application will be used by customers (or users) who should be able to use the products from the default_products
table, with their default value, but they should also be able to :
- edit and customize the default values of such product records for their own personal use - without affecting the product records of the other customers.
- add their own products, but these products should not be visible to other users.
One solution I could imagine would be:
- one
default_products
table containing all the default products with their default values- one
custom_products
table with all the products crated by the users, and also a copy of the default product the user would have customized, and a boolean field likeis_update
to indicate if it is an update from a default_product record- A function which looks first for the updated product records from the
custom_product
table, then queries thedefault_products
table and returns records from thedefault_product
table + only the updated and custom products for that user from thecustom_product
table.
Any idea if this is any good? Or does anybody have any easier way to do?
https://stackoverflow.com/questions/65768219/database-design-for-editable-table January 18, 2021 at 10:51AM
没有评论:
发表评论