Files
wekan/server/attachmentMigrationStatus.js
Lauri Ojansivu 39f3c89b0a Fixed upgrade crash.
Thanks to poc-sm and Claude !

Fixes #6367
2026-06-06 02:53:58 +03:00

20 lines
748 B
JavaScript

import { Meteor } from 'meteor/meteor';
import AttachmentMigrationStatus from '/models/attachmentMigrationStatus';
import { ensureIndex } from '/server/lib/mongoStartup';
// Allow/Deny rules
// This collection is server-only and should not be modified by clients
// Allow server-side operations (when userId is undefined) but deny all client operations
AttachmentMigrationStatus.allow({
insert: (userId) => !userId,
update: (userId) => !userId,
remove: (userId) => !userId,
});
// Create indexes for better query performance
Meteor.startup(() => {
ensureIndex(AttachmentMigrationStatus, { boardId: 1 });
ensureIndex(AttachmentMigrationStatus, { userId: 1, boardId: 1 });
ensureIndex(AttachmentMigrationStatus, { updatedAt: -1 });
});