lifecycle: fix migration conn_options for psycopg connection (#19134)

fix migrations to add conn_options to the psycopg connection
This commit is contained in:
Duncan Tasker
2026-01-05 03:58:40 -05:00
committed by GitHub
parent c3eb401600
commit bc24815ae6
2 changed files with 4 additions and 0 deletions
+2
View File
@@ -73,6 +73,7 @@ def release_lock(conn: Connection, cursor: Cursor):
def run_migrations():
conn_opts = CONFIG.get_dict_from_b64_json("postgresql.conn_options", default={})
conn = connect(
dbname=CONFIG.get("postgresql.name"),
user=CONFIG.get("postgresql.user"),
@@ -83,6 +84,7 @@ def run_migrations():
sslrootcert=CONFIG.get("postgresql.sslrootcert"),
sslcert=CONFIG.get("postgresql.sslcert"),
sslkey=CONFIG.get("postgresql.sslkey"),
**conn_opts,
)
curr = conn.cursor()
try:
+2
View File
@@ -18,6 +18,7 @@ def check_postgres():
if attempt >= CHECK_THRESHOLD:
sysexit(1)
try:
conn_opts = CONFIG.get_dict_from_b64_json("postgresql.conn_options", default={})
conn = connect(
dbname=CONFIG.refresh("postgresql.name"),
user=CONFIG.refresh("postgresql.user"),
@@ -28,6 +29,7 @@ def check_postgres():
sslrootcert=CONFIG.get("postgresql.sslrootcert"),
sslcert=CONFIG.get("postgresql.sslcert"),
sslkey=CONFIG.get("postgresql.sslkey"),
**conn_opts,
)
conn.cursor()
break