Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: disable des triggers non autorisés en prod #515

Merged
merged 1 commit into from
Dec 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading