Skip to content

Feature/83 create schemas to differentiate services#93

Open
Jxl-s wants to merge 2 commits into
developfrom
new-kids-adults-services-schemas
Open

Feature/83 create schemas to differentiate services#93
Jxl-s wants to merge 2 commits into
developfrom
new-kids-adults-services-schemas

Conversation

@Jxl-s
Copy link
Copy Markdown
Contributor

@Jxl-s Jxl-s commented Jun 5, 2026

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

  • 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)

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.

Copy link
Copy Markdown
Member

@RenaudBernier RenaudBernier left a comment

Choose a reason for hiding this comment

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

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.)

@RenaudBernier
Copy link
Copy Markdown
Member

Sorry for changing my issue, that's mb

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.

2 participants