mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +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) {
|
||||
for (let i = 0; i < rows.length; 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
|
||||
await knex(TableName.SecretApprovalPolicy)
|
||||
.whereIn(
|
||||
"id",
|
||||
batch.map((row) => row.id)
|
||||
)
|
||||
.update({ shouldCheckSecretPermission: true });
|
||||
await knex.raw(
|
||||
`
|
||||
UPDATE ??
|
||||
SET ?? = true
|
||||
WHERE ?? IN (${ids.map(() => "?").join(",")})
|
||||
`,
|
||||
[TableName.SecretApprovalPolicy, "shouldCheckSecretPermission", "id", ids]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user