fix(db-postgres): proper migrations table detection query (#7436)
Fixes postgres sql query to detect migrations table. `error: syntax error at or near "exists"`
This commit is contained in:
@@ -5,7 +5,7 @@ export const migrationTableExists = async (adapter: DrizzleAdapter): Promise<boo
|
|||||||
|
|
||||||
if (adapter.name === 'postgres') {
|
if (adapter.name === 'postgres') {
|
||||||
const prependSchema = adapter.schemaName ? `"${adapter.schemaName}".` : ''
|
const prependSchema = adapter.schemaName ? `"${adapter.schemaName}".` : ''
|
||||||
statement = `SELECT to_regclass('${prependSchema}"payload_migrations"') exists;`
|
statement = `SELECT to_regclass('${prependSchema}"payload_migrations"') AS exists;`
|
||||||
}
|
}
|
||||||
|
|
||||||
if (adapter.name === 'sqlite') {
|
if (adapter.name === 'sqlite') {
|
||||||
|
|||||||
Reference in New Issue
Block a user