Skip to content

fix: align Contact name field types with migration nullable=True#435

Merged
clstaudt merged 1 commit into
mainfrom
fix/contact-name-nullable-drift
Jul 26, 2026
Merged

fix: align Contact name field types with migration nullable=True#435
clstaudt merged 1 commit into
mainfrom
fix/contact-name-nullable-drift

Conversation

@clstaudt

Copy link
Copy Markdown
Contributor

Summary

  • PR fix: make contact name fields optional, reconcile #429 backfill #433 made migration bac018e35ce6 set contact.first_name/last_name to nullable=True, but left the model annotation as str (NOT NULL in SQLModel). This causes alembic check to report schema drift and would generate a spurious migration on just migrate.
  • Change the type annotation from str to Optional[str] so the model matches the database.
  • No new migration needed — the model now agrees with the existing migration chain.

Test plan

  • Full test suite passes (517 passed, 1 skipped)
  • alembic check reports no drift after the fix
  • Validator still coerces None"", so runtime behavior is unchanged

Made with Cursor

PR #433 made the migration set contact.first_name/last_name to
nullable=True but left the model annotation as `str` (NOT NULL).
Change to `Optional[str]` so `alembic check` reports no drift.

Co-authored-by: Cursor <cursoragent@cursor.com>
@clstaudt
clstaudt added this pull request to the merge queue Jul 26, 2026
Merged via the queue into main with commit c74a429 Jul 26, 2026
3 checks passed
@clstaudt
clstaudt deleted the fix/contact-name-nullable-drift branch July 26, 2026 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant