Answer the question
In order to leave comments, you need to log in
Users and work schedule: how to store?
Hello!
There are a number of users: Array U (user)
There is a work schedule, an array of dates D (date) with different states T (type): Working day, Day off, Sick leave, Day off, etc.
Brain torment for the second day already.. in what form is it better to store this array in the database..
[user_id][date] =[type]
[user_id][date_type] = {date, date2..date N}
[date] =[ [ user:type],[user2:type].. ]
to make it as easy as possible to make selections by dates and states for users ?
What is the best way to get away?
Answer the question
In order to leave comments, you need to log in
[user_id, date, type, INDEX(user_id), INDEX(date), UNIQUE(iser_id, date)]
What is the best way to store this array in the database?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question