task: Add title length constraint for recipe revisions #77
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.
Description
Added a database migration to enforce title length constraints on the recipe_revisions table. This ensures that recipe titles are meaningful and within reasonable bounds.
The constraint requires that recipe titles, when trimmed of whitespace, have a length between 3 and 150 characters. This prevents both empty/too-short titles and excessively long titles that could cause display issues.
Tested the constraint enforcement using GraphQL playground with a title exceeding less than 3 characters as well as over 150 characters:
Note: task migrate-up currently fails due to existing data in the database that violates the new constraint. This is expected behavior and will require data cleanup before the migration can be applied in production.
Checklist
Related Issues
Closes #72