Data · rule
migration.backfill_can_fail
Computed backfill can fail.
Area 5, Data; not declinable; the next step is usually the agent's.
A title can be empty or longer than five characters, so its length can
break Rank's min or max, and nothing says what such a record's rank
would be:
migration { Todo.rank: { backfill: Rank(text.length(Todo.title)) }}
error: The backfill for `Todo.rank` can fail --> database/migrations/20261020T1401_add_rank/changes.jadpo:3:19 |3 | backfill: Rank(text.length(Todo.title)) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can break `Rank`'s `min` and `max` reason: A backfill gives every `Todo` record already stored a value, and a record whose value failed would have none, so nothing in a backfill may fail. next: Work the value out with operations that can't fail, such as `integer.min` and `integer.max` to keep a number in its range (agent) rule: migration.backfill_can_fail help: https://jadpo.dev/docs/errors/migration.backfill_can_failcheck failed: 1 error, 4 files
Kept in its range with integer.min and integer.max, the construction
can't fail, and the backfill runs.
Markdown for agents: /docs/errors/migration.backfill_can_fail.md.Built from Jadpo main at a707efb.