Skip to content

fix(prisma): store classroom certifications as string arrays#581

Open
CarlyAThomas wants to merge 2 commits intofreeCodeCamp:mainfrom
CarlyAThomas:fix/prisma-fcccertifications-string-array
Open

fix(prisma): store classroom certifications as string arrays#581
CarlyAThomas wants to merge 2 commits intofreeCodeCamp:mainfrom
CarlyAThomas:fix/prisma-fcccertifications-string-array

Conversation

@CarlyAThomas
Copy link
Contributor

Co-authored-by: Newton Chung <NewtonLC@users.noreply.github.com>

Checklist:

Summary

  • Fixes Prisma runtime error caused by schema/data mismatch on classroom certifications.
  • Updates classroom certifications in Prisma schema from integer array to string array.
  • Re-baselines migrations into a single initial migration (dev-only cleanup).

Problem
Prisma was attempting to read fccCertifications as Int[], but existing rows contain dashed-name strings (for example, full-stack-developer-v9).
This caused prisma.classroom.findMany() to fail with an inconsistent column data conversion error.

Changes

  • Changed Classroom.fccCertifications type in Prisma schema from Int[] to String[].
  • Recreated migrations as a single fresh initial migration based on the current schema.
  • Regenerated Prisma client and applied migration locally.

Validation

  • npx prisma validate passes.
  • npx prisma generate passes.
  • npx prisma migrate status shows schema up to date.
  • Direct Prisma read query for classrooms succeeds and returns string-array certifications.
  • Existing test suite run completed successfully.

Notes

  • This is intended for development-stage migration cleanup.

  • Local DB was reset during migration re-baselining.

  • This PR is needed in order for prisma to handle the new curriculum changes.

@CarlyAThomas CarlyAThomas requested a review from a team as a code owner February 24, 2026 04:59
@NewtonLC
Copy link
Contributor

Since the codebase is still attempting to use https://www.freecodecamp.org/curriculum-data/v1... which is deprecated, it's hard to test these changes alone.

I was able to test the code in a different branch(CarlyAThomas:feat/v2-tiered-requirements), created a classroom, and got the intended result. fccCertifications in prisma should use strings:
image

Copy link
Contributor

@NewtonLC NewtonLC left a comment

Choose a reason for hiding this comment

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

Code in api_proccesor.js, [id].js, and [studentEmail].js need to be updated accordingly. Mentions of fccCertifications still assumes that it's a list of indices.

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