mirror of
https://github.com/outline/outline.git
synced 2026-06-13 11:25:03 +03:00
perf: Add missing indexes on foreign keys referencing documents (#12473)
* perf: Add missing indexes on foreign keys referencing documents Cascade deletes on the documents table were forced into sequential scans on file_operations, share_subscriptions, and access_requests because their documentId columns lacked a usable single-column index. Also fixes lint-staged to skip oxlint when every staged file matches an .oxlintrc.json ignore pattern, since oxlint exits 1 in that case. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * Handle oxlint no-files exit instead of mirroring ignorePatterns Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
"use strict";
|
||||
|
||||
/** @type {import('sequelize-cli').Migration} */
|
||||
module.exports = {
|
||||
async up(queryInterface) {
|
||||
await queryInterface.addIndex("file_operations", ["documentId"], {
|
||||
concurrently: true,
|
||||
});
|
||||
await queryInterface.addIndex("share_subscriptions", ["documentId"], {
|
||||
concurrently: true,
|
||||
});
|
||||
await queryInterface.addIndex("access_requests", ["documentId"], {
|
||||
concurrently: true,
|
||||
});
|
||||
},
|
||||
|
||||
async down(queryInterface) {
|
||||
await queryInterface.removeIndex("access_requests", ["documentId"]);
|
||||
await queryInterface.removeIndex("share_subscriptions", ["documentId"]);
|
||||
await queryInterface.removeIndex("file_operations", ["documentId"]);
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user