feat: migrate statuses and roles to real enums - #27
Open
jiggy-techy wants to merge 3 commits into
Open
Conversation
Adds TaskStatus, ClaimStatus, and UserRole enums to the Prisma schema and replaces the free-form string status/role columns on User, Task, and TaskClaim. The migration normalizes legacy lowercase values, fails with a clear error on any unrecognized value, and swaps the columns to native Postgres enum types. All services, middleware, controllers, seed data, and tests are updated to the typed enum values. Closes ecotask-network#5
cybermax4200
requested changes
Aug 17, 2026
cybermax4200
left a comment
Contributor
There was a problem hiding this comment.
Please fix the CI checks failure
Contributor
|
@jiggy-techy fix workflow |
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 #5
Summary
Migrates the free-form string status/role columns on
User,Task, andTaskClaimto real Prisma/Postgres enums.TaskStatus(ACTIVE/COMPLETED/EXPIRED),ClaimStatus(ACTIVE/RELEASED/EXPIRED),UserRole(USER/VALIDATOR/ADMIN).20260817000000_enum_statuses_rolesnormalizes legacy lowercase values, raises a clear error on any unrecognized value, and converts the columns to native Postgres enum types (with rollback SQL).Verification
prisma validate/prisma generatepassnpm run buildandnpm run lintpassnpm test: 166 passed; 1 pre-existing failure (proofs.test.ts"returns 401 without auth" — ECONNRESET, unrelated to this change, reproduced on the base commit).