feat(db): add children and emergency_contacts tables with related fields#62
Open
feat(db): add children and emergency_contacts tables with related fields#62
Conversation
RenaudBernier
requested changes
May 3, 2026
Comment on lines
+176
to
+185
| export const extraQuestions = pgTable("extra_questions", { | ||
| id: uuid("id").primaryKey().defaultRandom(), | ||
| serviceId: uuid("service_id") | ||
| .references(() => services.id, { onDelete: "cascade" }) | ||
| .notNull(), | ||
| type: extraQuestionTypeEnum("type").notNull(), | ||
| content: text("content").notNull(), | ||
| createdAt: timestamp("created_at").defaultNow().notNull(), | ||
| updatedAt: timestamp("updated_at").defaultNow().notNull(), | ||
| }); |
Contributor
There was a problem hiding this comment.
You are storing the questions, but not the answers. Make a new extraQuestionsAnswers table.
Author
There was a problem hiding this comment.
I made a few changes, firstly I added ur table, but also to support multiple diff question types such as checkmark and radio boxes I made a new type that is an attribute in a question and it has an id. then if a user answers one of those checkbox or radio button questions we save a id or array of ids in "answer" in extraQuestionAnswers. otherwise we store a normal string array with one element string which is the answer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.