重新设计数据库以允许每个用户更改默认对象

发布于 2024-10-09 14:25:23 字数 587 浏览 2 评论 0原文

我有一个数据库设计,可以在全球范围内存储多个项目的选项,老板现在希望能够在每个项目的基础上指定类别权重。

这是我当前的数据库设计......

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

冷血 2024-10-16 14:25:23

将单个列 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文