fix(vector): harden packaged migrations

This commit is contained in:
2026-07-12 01:32:33 +02:00
parent c0d50e9b08
commit 3588a7749b
14 changed files with 337 additions and 54 deletions
+2 -2
View File
@@ -45,8 +45,8 @@ def vector_configs():
)
engine = create_engine(pg.get_connection_url())
with engine.begin() as connection:
connection.exec_driver_sql("CREATE EXTENSION vector")
connection.exec_driver_sql("CREATE SCHEMA vectors")
connection.exec_driver_sql("CREATE EXTENSION vector WITH SCHEMA vectors")
for table in ("schema_records", "evidence", "memory"):
connection.exec_driver_sql(f"""
CREATE TABLE vectors.{table} (
@@ -55,7 +55,7 @@ def vector_configs():
kind text NOT NULL,
content_hash text NOT NULL,
metadata jsonb NOT NULL,
embedding vector(2) NOT NULL,
embedding vectors.vector(2) NOT NULL,
indexed_at timestamptz NOT NULL DEFAULT now()
)
""")