mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-08 08:27:53 +00:00
chore: made knex orm query to raw sql query
This commit is contained in:
@@ -14,13 +14,16 @@ export async function up(knex: Knex): Promise<void> {
|
|||||||
if (rows.length > 0) {
|
if (rows.length > 0) {
|
||||||
for (let i = 0; i < rows.length; i += BATCH_SIZE) {
|
for (let i = 0; i < rows.length; i += BATCH_SIZE) {
|
||||||
const batch = rows.slice(i, i + BATCH_SIZE);
|
const batch = rows.slice(i, i + BATCH_SIZE);
|
||||||
|
const ids = batch.map((row) => row.id);
|
||||||
// eslint-disable-next-line no-await-in-loop
|
// eslint-disable-next-line no-await-in-loop
|
||||||
await knex(TableName.SecretApprovalPolicy)
|
await knex.raw(
|
||||||
.whereIn(
|
`
|
||||||
"id",
|
UPDATE ??
|
||||||
batch.map((row) => row.id)
|
SET ?? = true
|
||||||
)
|
WHERE ?? IN (${ids.map(() => "?").join(",")})
|
||||||
.update({ shouldCheckSecretPermission: true });
|
`,
|
||||||
|
[TableName.SecretApprovalPolicy, "shouldCheckSecretPermission", "id", ids]
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user