mirror of
https://github.com/outline/outline.git
synced 2026-11-28 08:14:58 +03:00
perf: Add subscriptions documentId index for document delete cascade (#14688)
This commit is contained in:
1 parent
5935d4de3e
commit
6576bc832a
1 file changed
+17
@@ -0,0 +1,17 @@
|
||||
"use strict";
|
||||
|
||||
/** @type {import('sequelize-cli').Migration} */
|
||||
module.exports = {
|
||||
async up(queryInterface) {
|
||||
// Covers the foreign key cascade when a document is permanently deleted.
|
||||
await queryInterface.sequelize.query(
|
||||
'CREATE INDEX CONCURRENTLY IF NOT EXISTS "subscriptions_document_id" ON "subscriptions" ("documentId");'
|
||||
);
|
||||
},
|
||||
|
||||
async down(queryInterface) {
|
||||
await queryInterface.sequelize.query(
|
||||
'DROP INDEX CONCURRENTLY IF EXISTS "subscriptions_document_id";'
|
||||
);
|
||||
},
|
||||
};
|
||||
Reference in new issue
Block a user