Skip to content

fix: store deployment timestamps with microsecond precision on SQLite - #14010

Draft
HzaRashid wants to merge 2 commits into
release-1.11.0from
fix/deploy-ts-migrate
Draft

fix: store deployment timestamps with microsecond precision on SQLite#14010
HzaRashid wants to merge 2 commits into
release-1.11.0from
fix/deploy-ts-migrate

Conversation

@HzaRashid

Copy link
Copy Markdown
Collaborator

On SQLite, func.now() / datetime('now') store second-level precision (YYYY-MM-DD HH:MM:SS). When that same value is loaded into Python and SQLAlchemy later sends it as a query parameter, it is formatted with microsecond precision (...SS.ffffff). Comparisons then fail when one side is the stored ORM column value (still second-level text) and the other is SQLAlchemy's DateTime formatting of a previously loaded ORM datetime used as a parameter — even if both represent the same wall-clock second.

Rewriting once through DateTime(timezone=True), plus changing the deployment-family models to write UTC via Column default / onupdate, makes what is stored match what SQLAlchemy sends later, so ordinary equality/ordering work without per-query workarounds.

…Lite

SQLite func.now() wrote whole-second strings that failed keyset equality
against SQLAlchemy DateTime binds; rewrite existing rows and switch
deployment-family models to Python utc_now defaults.
@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 11835540-7da5-495e-9261-fc54d1289df8

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/deploy-ts-migrate

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the bug Something isn't working label Jul 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Migration Validation Passed

All migrations follow the Expand-Contract pattern correctly.

@erichare
erichare deleted the branch release-1.11.0 July 15, 2026 18:36
@erichare erichare closed this Jul 15, 2026
@erichare erichare reopened this Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ignore-for-release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants