Representing Free time Hours/Day in Relational Database

Viewed 31

I'm developing a schedule, where the users can but all free time they have. For example:

  • Mon free time: 6:00, 8:00, 19:00, 20:00, 21:00;
  • Tue free time: 8:00, 19:00, 20:00;
  • Wed free time: 19:00, 21:00;
  • etc

I'm using TypeORM, working in Postgres 14. I thought of using the type ARRAY with just one table (days), but saw that isn't a good pratice; I want work with more tables, maybe one table days and other table hours.

How can I do the relations?

Edit: I do something like that diagram ER

i don't thing is the best way...

0 Answers
Related