Feature/83 create schemas to differentiate services#93
Open
Jxl-s wants to merge 2 commits into
Open
Conversation
RenaudBernier
requested changes
Jun 5, 2026
Member
RenaudBernier
left a comment
There was a problem hiding this comment.
I just realized that we need to change some table and column names because we are going from "extra questions" to "form questions".
I added 2 new bullet points in the issue.
Here they are:
- Rename extra_questions → form_questions and extra_question_answers → form_question_answers, now that questions belong to forms rather than being generic "extra" questions. Carry the rename through the related identifiers for consistency: FK extra_question_id → form_question_id, enum extra_question_type → form_question_type, and the ExtraQuestionOption type → FormQuestionOption. Update all Drizzle schema, queries, actions, and components that reference them.
- Change the renamed form_questions table to reference form_id (forms.id, onDelete: cascade) instead of service_id. Forms now own their questions, which makes a form reusable across services. (Breaking change to the old extra_questions table.)
Member
|
Sorry for changing my issue, that's mb |
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 #83
Overview
Updates the database schema to support kid vs. adult service differentiation, reusable forms, and per-child registrations.
Testing
Schema-only change. No application logic modified. Verified by confirming all columns and the partial unique index exist in the database after applying the migration.
Screenshots / Screencasts
N/A
Checklist
Notes
Note on migrations: The Drizzle migration workflow is currently broken, as drizzle/meta was added to .gitignore at some point, meaning the migration journal isn't shared across developers. Combined with manual schema changes made directly in Supabase, the DB state has diverged from what Drizzle tracks, making db:migrate fail. Because of this, the schema changes for this PR were applied directly via Supabase migrations. schema.ts has been updated to reflect the actual DB state (including several columns that existed in the DB but were missing from the file). The Drizzle migration workflow should be fixed as a follow-up before it's used again.