Skip to content

Commit b5b2bb1

Browse files
authored
fix(db-postgres): proper migrations table detection query (#7436)
Fixes postgres sql query to detect migrations table. `error: syntax error at or near "exists"`
1 parent 6f5cf5d commit b5b2bb1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/drizzle/src/utilities/migrationTableExists.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export const migrationTableExists = async (adapter: DrizzleAdapter): Promise<boo
55

66
if (adapter.name === 'postgres') {
77
const prependSchema = adapter.schemaName ? `"${adapter.schemaName}".` : ''
8-
statement = `SELECT to_regclass('${prependSchema}"payload_migrations"') exists;`
8+
statement = `SELECT to_regclass('${prependSchema}"payload_migrations"') AS exists;`
99
}
1010

1111
if (adapter.name === 'sqlite') {

0 commit comments

Comments
 (0)