From 2fdecb5d1968d2bc68f425f2e8c7695f3e0e2f5a Mon Sep 17 00:00:00 2001 From: Eric Mc Sween <5454374+emcsween@users.noreply.github.com> Date: Thu, 23 Apr 2026 11:35:42 -0400 Subject: [PATCH] Merge pull request #32956 from overleaf/em-library-entry-list Show library entry list on /library page GitOrigin-RevId: 6c1c4e3ef66ea002525e5d5adb7943123f5d2587 --- .../web/app/src/infrastructure/mongodb.mjs | 1 + ...braryReferences_userId_updatedAt_index.mjs | 26 +++++++++++++++++++ tools/migrations/lib/mongodb.mjs | 1 + 3 files changed, 28 insertions(+) create mode 100644 tools/migrations/20260420120000_create_libraryReferences_userId_updatedAt_index.mjs diff --git a/services/web/app/src/infrastructure/mongodb.mjs b/services/web/app/src/infrastructure/mongodb.mjs index ec9a3e0065..d61f45f5f0 100644 --- a/services/web/app/src/infrastructure/mongodb.mjs +++ b/services/web/app/src/infrastructure/mongodb.mjs @@ -53,6 +53,7 @@ export const db = { grouppolicies: internalDb.collection('grouppolicies'), groupAuditLogEntries: internalDb.collection('groupAuditLogEntries'), institutions: internalDb.collection('institutions'), + libraryReferences: internalDb.collection('libraryReferences'), messages: internalDb.collection('messages'), migrations: internalDb.collection('migrations'), notifications: internalDb.collection('notifications'), diff --git a/tools/migrations/20260420120000_create_libraryReferences_userId_updatedAt_index.mjs b/tools/migrations/20260420120000_create_libraryReferences_userId_updatedAt_index.mjs new file mode 100644 index 0000000000..2f3ca88e29 --- /dev/null +++ b/tools/migrations/20260420120000_create_libraryReferences_userId_updatedAt_index.mjs @@ -0,0 +1,26 @@ +import Helpers from './lib/helpers.mjs' + +const tags = ['saas'] + +const indexes = [ + { + key: { userId: 1, updatedAt: 1 }, + name: 'userId_1_updatedAt_1', + }, +] + +const migrate = async client => { + const { db } = client + await Helpers.addIndexesToCollection(db.libraryReferences, indexes) +} + +const rollback = async client => { + const { db } = client + await Helpers.dropIndexesFromCollection(db.libraryReferences, indexes) +} + +export default { + tags, + migrate, + rollback, +} diff --git a/tools/migrations/lib/mongodb.mjs b/tools/migrations/lib/mongodb.mjs index dc0ad2c214..d1652d3666 100644 --- a/tools/migrations/lib/mongodb.mjs +++ b/tools/migrations/lib/mongodb.mjs @@ -29,6 +29,7 @@ export const db = { grouppolicies: internalDb.collection('grouppolicies'), groupAuditLogEntries: internalDb.collection('groupAuditLogEntries'), institutions: internalDb.collection('institutions'), + libraryReferences: internalDb.collection('libraryReferences'), messages: internalDb.collection('messages'), migrations: internalDb.collection('migrations'), notifications: internalDb.collection('notifications'),