From 8e456a2b45e6f413d11c6fa92d6b5e22c0594aae Mon Sep 17 00:00:00 2001 From: Ryan Date: Mon, 23 Dec 2024 01:53:11 +0700 Subject: [PATCH] fix: remove nonsensical schema check from postgres-adapter --- packages/adapter-postgres/src/index.ts | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/packages/adapter-postgres/src/index.ts b/packages/adapter-postgres/src/index.ts index f1942b9fef..a50505e5f0 100644 --- a/packages/adapter-postgres/src/index.ts +++ b/packages/adapter-postgres/src/index.ts @@ -203,21 +203,11 @@ export class PostgresDatabaseAdapter await client.query("SET app.use_ollama_embedding = 'false'"); } - // Check if schema already exists (check for a core table) - const { rows } = await client.query(` - SELECT EXISTS ( - SELECT FROM information_schema.tables - WHERE table_name = 'rooms' - ); - `); - - if (!rows[0].exists) { - const schema = fs.readFileSync( - path.resolve(__dirname, "../schema.sql"), - "utf8" - ); - await client.query(schema); - } + const schema = fs.readFileSync( + path.resolve(__dirname, "../schema.sql"), + "utf8" + ); + await client.query(schema); await client.query("COMMIT"); } catch (error) {