Skip to content

feat(db): add children and emergency_contacts tables with related fields#62

Merged
RenaudBernier merged 6 commits into
developfrom
feature/60-child-registration-tables
May 19, 2026
Merged

feat(db): add children and emergency_contacts tables with related fields#62
RenaudBernier merged 6 commits into
developfrom
feature/60-child-registration-tables

Conversation

@achneerov

@achneerov achneerov commented May 3, 2026

Copy link
Copy Markdown
Contributor

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

  • Code is neat, readable, and works
  • Code is commented where appropriate and well-documented
  • Commit messages follow our guidelines
  • Issue number is linked
  • Branch is linked
  • Reviewers are assigned (one of your tech leads)

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.

Comment thread lib/db/schema.ts

@RenaudBernier RenaudBernier left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@martin0024 martin0024 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good job alex, nothing to say here. small tweaks.

Comment thread .env.example

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: why did you remove the .env.example in this pr? is there any particular reason of that choice?

Comment thread lib/db/schema.ts Outdated
Comment thread lib/db/schema.ts
Comment on lines +171 to +173
childId: uuid("child_id")
.references(() => children.id, { onDelete: "cascade" })
.notNull(),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

childId FK with no uniqueness means contacts are duplicated per sibling.
if a family has 3 kids the same grandparent gets 3 rows.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I talked with Mattia. You're right Alex, we're keeping it like this.

@RenaudBernier RenaudBernier left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>

@RenaudBernier RenaudBernier left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thank you Alex

@RenaudBernier RenaudBernier merged commit 8bd75bb into develop May 19, 2026
1 check passed
@RenaudBernier RenaudBernier deleted the feature/60-child-registration-tables branch June 25, 2026 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants