yesodweb / yesodweb/persistent
RFC: Should MigrationOnly indicate nullability?
Nobody has claimed this yet.
- Dominant language
- Haskell
- Stars
- 486
- Forks
- 306
- PR merge metrics
- No merged PRs in 30d
Description
Currently, using MigrationOnly on a column will omit the field from the Haskell datatype but the resulting SQL is still intact.
This means if you do an insert on a record with a non-nullable (and no default) MigrationOnly column that it will fail at runtime with a "missing value" error.
You can fix this by doing field FieldType Maybe MigrationOnly. Should MigrationOnly imply Maybe?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files or tests are named. Start by tracing how MigrationOnly columns affect generated Haskell record fields, SQL schemas, and inserts, comparing the non-nullable case with an explicit Maybe field. Done requires a maintainer decision on whether MigrationOnly should imply Maybe and agreement on the resulting insert behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- haskell
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100