重新设计数据库以允许每个用户更改默认对象
我有一个数据库设计,可以在全球范围内存储多个项目的选项,老板现在希望能够在每个项目的基础上指定类别权重。
这是我当前的数据库设计......
Category (grouping of items)
-name
-weight
Item (a task that needs completed for objects)
-name
-id_category
-order_by
-(other info here)
Project
-name
-(lots of other stuff)
ProjectItems
-id_item
-id_project
-status (enum - not complete, in progress, complete)
度量被分组为类别,它们在计算完成百分比时使用自己的权重(完成了多少项目与项目的项目总数。某些类别比其他的,所以当某个类别的项目完成时,他们应该使完成百分比相对跳跃)。
该模型目前运行得非常好,创建的每个项目都会根据用户从提交的表单中进行的选择来填充对象项。
重新设计数据库以支持每个项目类别权重的最佳方法是什么?
注意:类别不需要改变,只需要改变权重即可。
I have a database design that stores options for multiple projects globally, boss man now wants the ability to specify the category weight on a per project bases.
This is my current database design....
Category (grouping of items)
-name
-weight
Item (a task that needs completed for objects)
-name
-id_category
-order_by
-(other info here)
Project
-name
-(lots of other stuff)
ProjectItems
-id_item
-id_project
-status (enum - not complete, in progress, complete)
Measures are grouped into categories, which have their own weights used in the calculation of percentage complete (how many items are completed vs total number of items for a project.. some categories are more complex than others, so when items from a certain category are finished, they should make the percentage complete jump relatively).
This model currently works really well, every project that is created gets object items populated based on user selection from a submitted form.
What would be the best way to re-design the database to support per-project category weights just for boss man?
Notes: The categories should not need to ever change, just the weights.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将单个列 catWeight 添加到与 Catagory 表中的重量列类型相同的 Item 表中。为项目创建新项目时,将该列设置为类别表中的值。允许用户修改 catWeight 列中的值。
Add a single column, catWeight, to your Item table of the same type as the weight column in the Catagory table. When a new item is created for a project set the column to the value in the catagory table. Allow the user to modify the value in the catWeight column.