Schema Description
A project s status can change over time. In order to track the status over time, I ve created a many-to-many relationship between the Project
model and the ProjectStatusType
model through the ProjectStatus
intermediary table.
While this allows tracking a project s status over time, it increases the complexity of the schema such that retrieving the current status of a project or retrieving all open projects is more difficult.
Use Case
我希望能够归还所有处于特定状态的项目,例如所有<条码>>开放/代码>项目。 例如,用户到http://www.example.com/projects, 我只读到<代码>开放代码>的项目,按违约情况在表格中展示。
Questions
- Should I denormalize the schema and add a
current_status
field in theProject
model? - If I shouldn t denormalize, what strategy should I use to retrieve the current status for each project? Should I create a property on the
Project
model that retrieves the current status?