Skip to content

fix(database): make PostgreSQL migrations locale-safe - #173

Merged
ichwars merged 2 commits into
mainfrom
dev-issue-142-postgres-migration-utc
Sep 7, 2026
Merged

fix(database): make PostgreSQL migrations locale-safe#173
ichwars merged 2 commits into
mainfrom
dev-issue-142-postgres-migration-utc

Conversation

@ichwars

@ichwars ichwars commented Sep 7, 2026

Copy link
Copy Markdown
Owner

Closes #142

Summary

  • classify already-applied PostgreSQL DDL by stable SQLSTATE codes instead of localized error text, while preserving SQLite's stable fallback
  • re-raise unexpected migration failures and keep missing-column tolerance limited to RENAME COLUMN
  • pin PostgreSQL sessions to UTC so server-generated naive timestamps match PrintOps' UTC contract
  • align support queue age and retention cutoffs with the same naive-UTC clock
  • add unit coverage plus a real PostgreSQL 16 CI job for repeated startup, localized errors, unexpected failures, and a non-UTC database default

Upstream comparison

Selectively adapts the relevant behavior from maziggy/bambuddy commits ea89814 and 28b2b9f after comparison with PrintOps' current migration flow. PrintOps' migration ordering, SQLite behavior, domain boundaries, and existing timestamp history are preserved. Historical timestamp rows are deliberately not rewritten because their origin cannot be proven safely.

Documentation

  • No docs update required — this is an internal database-compatibility correction with no new user-facing configuration

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • Test addition or update

Testing

  • Issue-specific unit suite: 17 passed
  • Migration/support regression selection: 136 passed
  • Full backend suite: 8,623 passed, 254 skipped; 5 pre-existing warnings
  • Full Ruff lint and formatting checks
  • Dependency boundaries, source-size budget, YAML parsing, and diff checks
  • Dedicated PostgreSQL CI job: PostgreSQL 16, Europe/Istanbul database default, repeated init_db(), German/Russian error text, SQLSTATE classification, unexpected-error propagation, and UTC server defaults

Checklist

  • My code follows the project's coding style
  • I have commented my code where necessary
  • My changes generate no new warnings
  • I have tested my changes thoroughly
  • No protected PrintOps business-domain behavior was removed

Additional Notes

The local Docker daemon was unavailable, so the live PostgreSQL proof is intentionally enforced by the new PR CI job and must pass before merge. No frontend files are changed.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 7, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-07T08:46:37.066110Z e691a56 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@ichwars
ichwars merged commit df148e2 into main Sep 7, 2026
27 checks passed
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.

PostgreSQL-Migrationen sprachunabhängig und Zeitstempel konsistent ausführen

1 participant