Skip to content

database migration error fix#7

Merged
SCGR-1 merged 1 commit into
mainfrom
Nov_3
Nov 16, 2025
Merged

database migration error fix#7
SCGR-1 merged 1 commit into
mainfrom
Nov_3

Conversation

@SCGR-1

@SCGR-1 SCGR-1 commented Nov 16, 2025

Copy link
Copy Markdown
Owner

No description provided.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread py_backend/alembic/env.py
Comment on lines +51 to +53
# Add sslmode=require for non-localhost connections (production)
if "sslmode=" not in url and "localhost" not in url and "127.0.0.1" not in url:
url = f"{url}{'&' if '?' in url else '?'}sslmode=require"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Avoid unconditionally appending sslmode=require

The new _get_db_url appends sslmode=require whenever the URL host is not literally localhost or 127.0.0.1. Many existing local/docker deployments connect to Postgres over service names such as db or postgres without TLS. Those URLs will now always receive sslmode=require, causing Alembic to fail to connect because the server is not configured for SSL. This change will break migrations in common non‑TLS environments and should be guarded by an explicit setting rather than inferring from the hostname.

Useful? React with 👍 / 👎.

@SCGR-1 SCGR-1 merged commit e6d6b0a into main Nov 16, 2025
3 checks passed
@SCGR-1 SCGR-1 deleted the Nov_3 branch March 6, 2026 11:56
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