Boris Povolotsky
TTCTheo's Typesafe Cult
•Created by Boris Povolotsky on 2/22/2024 in #questions
help with DB schema
Hi, I need help with designing a database, I'm fairly new to SQL (postgres) and I'm terrified of over-engineering.
Essentially, I'm building an app for an organization that has dozen of workplaces, each consisting of a team of therapists with the following requirements:
- Each workplace/location needs a weekly schedule, which therapist in which room, and with which client.
- they don't need a yearly calendar.
- No one-off events/sessions.
There are usually between 4-6 therapists and 8-9 clients.
My thoughts:
Create a table with columns:
and another table with with cols:
I'm unfamiliar with SQL and don't know how many tables is too many for a small application, so I'm afraid of committing horrible design mistakes now.
Is this a good approach to the problem?
A 'stupid' alternative is to shove everything in the events table. I'm not sure how, use an array of IDs in a "participants" column? I read everywhere that using arrays is dangerous in DB, idk why.
2 replies
TTCTheo's Typesafe Cult
•Created by Boris Povolotsky on 10/12/2023 in #questions
Is it idiomatic TypeScript: using as const?
Hi, this is typescript related.
Is there a way to avoid <const> or as const hell?
I have an object type that has several fields that are unions for example:
then inside code:
Is this idiomatic TypeScript? or am I commiting a crime?
3 replies