Skip to content

CubeLoop — a Pythonic, async-native agent harness core designed for high performance, readability, and production-grade persistence.

fix(recovery): recognize partitioned postgres indexes

xf gongd7a5c486b69a
diff --git a/tests/checkpointer/test_postgres_schema_version_v3.py b/tests/checkpointer/test_postgres_schema_version_v3.py
index 223e691..a85e4cc 100644
--- a/tests/checkpointer/test_postgres_schema_version_v3.py
+++ b/tests/checkpointer/test_postgres_schema_version_v3.py
@@ -27,7 +27,7 @@ async def test_postgres_v2_database_refused_with_actionable_error(clean_db) -> N
pass
msg = str(ei.value)
- assert "expected 6" in msg or "expected=6" in msg
+ assert "expected 5" in msg or "expected=5" in msg
assert "actual 2" in msg or "actual=2" in msg
# Hint mentions the host alembic migration path so operators know what to do.
assert "alembic" in msg.lower()
@@ -59,6 +59,6 @@ async def test_mysql_v2_database_refused_with_actionable_error(clean_mysql_db) -
pass
msg = str(ei.value)
- assert "expected 6" in msg or "expected=6" in msg
+ assert "expected 5" in msg or "expected=5" in msg
assert "actual 2" in msg or "actual=2" in msg
assert "alembic" in msg.lower()
diff --git a/website/static/recovery/0.14.0/postgres-v6-to-v5.sql b/website/static/recovery/0.14.0/postgres-v6-to-v5.sql
index 7a6c03f..91c60fb 100644
--- a/website/static/recovery/0.14.0/postgres-v6-to-v5.sql
+++ b/website/static/recovery/0.14.0/postgres-v6-to-v5.sql
@@ -30,13 +30,13 @@ BEGIN
END IF;
SELECT count(*) INTO new_index_count
FROM pg_class c JOIN pg_namespace n ON n.oid = c.relnamespace
- WHERE relkind = 'i' AND relname IN (
+ WHERE relkind IN ('i', 'I') AND relname IN (
'ix_cubeloop_messages_metadata_gin',
'ix_cubeloop_messages_thread_run', 'ix_cubeloop_runs_thread_seq'
) AND n.nspname = schema_name;
SELECT count(*) INTO old_index_count
FROM pg_class c JOIN pg_namespace n ON n.oid = c.relnamespace
- WHERE relkind = 'i' AND relname IN (
+ WHERE relkind IN ('i', 'I') AND relname IN (
'ix_cubepi_messages_metadata_gin',
'ix_cubepi_messages_thread_run', 'ix_cubepi_runs_thread_seq'
) AND n.nspname = schema_name;