mirror of
https://github.com/strapi/strapi.git
synced 2025-12-27 23:24:03 +00:00
fix(database): refactor getConnection to not use schemas
This commit is contained in:
parent
cad6a8da1c
commit
0f7eb70fd2
@ -243,9 +243,8 @@ const cleanOrderColumns = async ({ id, attribute, db, inverseRelIds, transaction
|
||||
.transacting(trx);
|
||||
break;
|
||||
default: {
|
||||
const dbConnection =
|
||||
strapi.db.dialect.client === 'postgres' ? db.connection : db.getConnection();
|
||||
await dbConnection
|
||||
await db
|
||||
.getConnection()
|
||||
.raw(
|
||||
`UPDATE ?? as a
|
||||
SET ${update.join(', ')}
|
||||
|
||||
@ -48,9 +48,7 @@ class Database {
|
||||
}
|
||||
|
||||
getConnection(tableName) {
|
||||
const schema = this.connection.getSchemaName();
|
||||
const connection = tableName ? this.connection(tableName) : this.connection;
|
||||
return schema ? connection.withSchema(schema) : connection;
|
||||
return tableName ? this.connection(tableName) : this.connection;
|
||||
}
|
||||
|
||||
getSchemaConnection(trx = this.connection) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user