Skip to content

Commit

Permalink
fix(postgres-adapter): remove nonsensical schema check
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanleecode committed Dec 22, 2024
1 parent e37fb6d commit 07bbd66
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions packages/adapter-postgres/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,21 +189,11 @@ export class PostgresDatabaseAdapter
try {
await client.query("BEGIN");

// 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) {
Expand Down

0 comments on commit 07bbd66

Please sign in to comment.