Skip to content

Commit

Permalink
Merge pull request #515 from mission-apprentissage/fix/migration-CS-MC
Browse files Browse the repository at this point in the history
fix: disable des triggers non autorisés en prod
  • Loading branch information
LucasDetre authored Dec 20, 2024
2 parents 5c1e27f + 3528621 commit b136e46
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 b136e46

Please sign in to comment.