mirror of
https://github.com/strapi/strapi.git
synced 2025-12-27 23:24:03 +00:00
Merge branch 'main' into enhancement/axios-refactoring
This commit is contained in:
commit
16c9f10f38
@ -226,8 +226,7 @@ const cleanOrderColumns = async ({ id, attribute, db, inverseRelIds, transaction
|
||||
// https://github.com/knex/knex/issues/2504
|
||||
switch (strapi.db.dialect.client) {
|
||||
case 'mysql':
|
||||
await db
|
||||
.getConnection()
|
||||
await db.connection
|
||||
.raw(
|
||||
`UPDATE
|
||||
?? as a,
|
||||
@ -243,17 +242,16 @@ const cleanOrderColumns = async ({ id, attribute, db, inverseRelIds, transaction
|
||||
.transacting(trx);
|
||||
break;
|
||||
default:
|
||||
await db
|
||||
.getConnection()
|
||||
await db.connection
|
||||
.raw(
|
||||
`UPDATE ?? as a
|
||||
SET ${update.join(', ')}
|
||||
FROM (
|
||||
SELECT ${select.join(', ')}
|
||||
FROM ??
|
||||
WHERE ${where.join(' OR ')}
|
||||
) AS b
|
||||
WHERE b.id = a.id`,
|
||||
SET ${update.join(', ')}
|
||||
FROM (
|
||||
SELECT ${select.join(', ')}
|
||||
FROM ??
|
||||
WHERE ${where.join(' OR ')}
|
||||
) AS b
|
||||
WHERE b.id = a.id`,
|
||||
[joinTable.name, ...updateBinding, ...selectBinding, joinTable.name, ...whereBinding]
|
||||
)
|
||||
.transacting(trx);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user