管理每周时间表的数据库模式 [英] Database schema that manages weekly timesheets
问题描述
我写这篇文章是因为我想知道是否有人可以帮我找出一个简单的时间表应用程序的最佳数据库模式。
我无法找出如何用图表来帮助我代表一年中的几个星期,所有的用户都会记录他们的工作时间。
干杯,许多感谢您的帮助! :)
Guillermo
我们使用的模型,(花费太多时间格式化以正确内联呈现)
I'm writing this post because I was wondering if somebody could help me to figure out how the best database schema for a simple timesheets app will be.
I can't figure out how to diagram tables that help me to represent weeks of the year, where all the users will log their work week hours.
Cheers, and many thanks for your help! :)
Guillermo
I will share with you a typical model that we use, https://www.dropbox.com/s/3wo9qd2fdpe5yow/timesheet_model.png, and describe each of the tables:
- useraccount - user information, login etc
- project - the projects that a user can work on
- projectassignment - the assignment of a project to a user, so these are the only projects that the user can see and submit time on
- timesheet - summary information on the timesheet, which week its for, comments etc
- timesheetdetails - a row for each day and each project with the hours worked, this table grows very fast. We also include the projectid foreign key in this table to speed up queries
- approval - a record of approvals made on the timesheet, as there may be a rejection before its approved
Hope this helps
The link to the SQL schema is https://www.dropbox.com/s/uadl5689v9j0jcs/timesheet_model_schema.sql (was taking too much time to format to render properly inline)
这篇关于管理每周时间表的数据库模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!