Skip to content

Commit

Permalink
fix: disable des triggers non autorisés en prod
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasDetre committed Dec 20, 2024
1 parent 5c1e27f commit 3528621
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions server/src/migrations/migration_1734618351550.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,21 +115,7 @@ export const up = async (db: Kysely<unknown>) => {
sqlQuery += `UPDATE intention SET cfd = '${nouveauCFD}' WHERE cfd = '${ancienCFD}' AND id in (SELECT id FROM "latestIntentionView");\n`;
});

// disable les triggers qui utilisent trop de mémoire sur des opérations massives
await getKbdClient().executeQuery(
sql`
ALTER TABLE demande DISABLE TRIGGER ALL;
ALTER TABLE intention DISABLE TRIGGER ALL;
`.compile(db)
);
await getKbdClient().executeQuery(sql.raw(sqlQuery).compile(db));
// enable les triggers
await getKbdClient().executeQuery(
sql`
ALTER TABLE demande ENABLE TRIGGER ALL;
ALTER TABLE intention ENABLE TRIGGER ALL;
`.compile(db)
);

await getKbdClient().executeQuery(
sql`
Expand Down

0 comments on commit 3528621

Please sign in to comment.