diff --git a/cognee/infrastructure/databases/vector/pgvector/create_db_and_tables.py b/cognee/infrastructure/databases/vector/pgvector/create_db_and_tables.py index a01d368e0..2f4c9cf3f 100644 --- a/cognee/infrastructure/databases/vector/pgvector/create_db_and_tables.py +++ b/cognee/infrastructure/databases/vector/pgvector/create_db_and_tables.py @@ -2,19 +2,11 @@ from ..get_vector_engine import get_vector_engine, get_vectordb_config from sqlalchemy import text -# Note: Variable is used like a caching mechanism to not recreate tables in case they were already created -created=False - async def create_db_and_tables(): vector_config = get_vectordb_config() vector_engine = get_vector_engine() if vector_config.vector_db_provider == "pgvector": - global created - if not created: - await vector_engine.create_database() - created = True - async with vector_engine.engine.begin() as connection: await connection.execute(text("CREATE EXTENSION IF NOT EXISTS vector;"))