mirror of
https://github.com/rommapp/romm.git
synced 2026-12-04 21:02:21 +01:00
* test(backend): catch column nullability drift between models and migrations Alembic's autogenerate ignores a nullability mismatch on a generated column whenever the model leaves `nullable=` unset, which `Mapped[...]` inference does. Such a mismatch surfaced in review on #4647 with no check here able to see it. Two guards close the gap: - a reflection test comparing every mapped column's nullability (and existence) against the migrated schema, skipping views; - a static test requiring every database-filled column to pass `nullable=` explicitly, so autogenerate compares it again. The five existing `FetchedValue` columns on `roms` now declare `nullable=True`, matching their DDL. No schema change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VgcWNtJy6ucWRaibqNKNJC * test(backend): check server_onupdate in the database-filled nullability guard Alembic skips the nullability comparison whenever the reflected column is generated, so a column mapped with only `server_onupdate=FetchedValue()` is just as invisible to autogenerate as one with `server_default`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VgcWNtJy6ucWRaibqNKNJC * test(backend): trim the drift test docstrings to one sentence Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VgcWNtJy6ucWRaibqNKNJC --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>