8 months ago

Absence Table with Individual Records for each Day (CRUD)

Posted 8 months ago by Bromira

First of all, thanks for any help/advice in advance.

I'm trying to track sickness and absence; normally id just have a simple table with something along the lines of:

uid | user_id | absence_start | absence_end | reason

but I'd like to be able to split to add comments for individual dates when the user checks in with us, so far I've come up with:

  1. Take a start datetime / end datetime and write a quick function to split them into individual rows - I'm worried this would be hard to maintain when editing an instance of absence (ie. if I reported someone as absent for 5 days then modified to 3 how would I keep the database consistent?).
  2. Having a table for sickness as above and a secondary linked table for comments / actions.

Could someone help point me in the right direction re. best practice in these cases?

Please sign in or create an account to participate in this conversation.