Skip to content

Fix catalog timestamp column compatibility#4

Closed
cursor[bot] wants to merge 1 commit into
masterfrom
cursor/critical-bug-inspection-1aff
Closed

Fix catalog timestamp column compatibility#4
cursor[bot] wants to merge 1 commit into
masterfrom
cursor/critical-bug-inspection-1aff

Conversation

@cursor
Copy link
Copy Markdown
Contributor

@cursor cursor Bot commented Apr 29, 2026

Bug and impact

Recent timestamp changes edited the existing catalog migration from TIMESTAMPTZ to TIMESTAMP and changed repository mapping to NaiveDateTime. Databases that had already applied the original migration keep TIMESTAMPTZ columns, so after deploying the new code catalog reads, lists, creates, and updates can fail with sqlx/Postgres type errors instead of serving data.

Root cause

The checked-in migration was mutated after it had already defined timezone-aware timestamp columns, while the repository was updated to bind/decode timezone-less timestamps. That made the application binary incompatible with already-migrated databases.

Fix

Restore the migration schema contract to TIMESTAMPTZ and restore repository binding/row mapping to chrono::DateTime<Utc>.

Validation

  • rustfmt --edition 2021 catalog-svc/catalog-svc/src/catalog/repository.rs
  • git diff --check
  • ./gradlew build to generate missing Smithy projections
  • CC=gcc CXX=g++ ./catalog-svc/generate-openapi.sh to generate missing OpenAPI input for the client build
  • CC=gcc CXX=g++ cargo test -p catalog-svc --lib --bins passes

Database integration validation note: CC=gcc CXX=g++ cargo test -p catalog-svc compiles and runs non-DB targets, then tests/catalog_crud.rs fails with PoolTimedOut because no PostgreSQL service is running in this VM. Attempting to start the repo's compose stack was blocked by docker: command not found.

Open in Web View Automation 

Co-authored-by: Bruno Medeiros <bruno.do.medeiros@gmail.com>
@bruno-medeiros
Copy link
Copy Markdown
Owner

Not applicable, application is not deployed yet so there is not database to migrate. Breaking changes are okay at this point.

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.

2 participants