feat(db): add children and emergency_contacts tables with related fields#62
Conversation
martin0024
left a comment
There was a problem hiding this comment.
good job alex, nothing to say here. small tweaks.
There was a problem hiding this comment.
question: why did you remove the .env.example in this pr? is there any particular reason of that choice?
| childId: uuid("child_id") | ||
| .references(() => children.id, { onDelete: "cascade" }) | ||
| .notNull(), |
There was a problem hiding this comment.
childId FK with no uniqueness means contacts are duplicated per sibling.
if a family has 3 kids the same grandparent gets 3 rows.
There was a problem hiding this comment.
That seems fine? if it is unique then we can't have multiple emergency contacts per child unless its some composite, idk it seems kinda overkill. What are you suggesting exactly?
There was a problem hiding this comment.
I talked with Mattia. You're right Alex, we're keeping it like this.
RenaudBernier
left a comment
There was a problem hiding this comment.
update docs to reflect the db changes please
Co-authored-by: ϻartin <51332188+martin0024@users.noreply.github.com> Signed-off-by: Alexander Chneerov <123044733+achneerov@users.noreply.github.com>
…tions, and extra_question_answers tables
RenaudBernier
left a comment
There was a problem hiding this comment.
Looks good, thank you Alex
Closes #60
Overview
Updating table
Testing
Visual inspection, did not want to actually apply the changes to the db to prevent regressions
Screenshots / Screencasts
n/a
Checklist
Tip: You can make the issue and then check them after the fact or replace
[ ]with[x]to check it!Notes
There is a bit of an issue with the circular dependency between children and emergency contacts, however I think that the best approach is to ignore it for now and when you try to implement the adding children you will realize the issue and adjust your function accordingly, and at that point we can think about making a generalized function.