Clear upload bootstrap old mongoose code

This commit is contained in:
Alexandre Bodin 2021-06-28 22:40:45 +02:00
parent fe4e355b24
commit c3064a26d2

View File

@ -24,7 +24,6 @@ module.exports = async () => {
});
}
// await pruneObsoleteRelations();
await registerPermissionActions();
};
@ -69,31 +68,6 @@ const baseProvider = {
},
};
// const pruneObsoleteRelations = async () => {
// const { upload: plugin } = strapi.plugins;
// const modelIsNotDefined = !plugin || !plugin.models || !plugin.models.file;
// if (modelIsNotDefined) {
// return Promise.resolve();
// }
// await strapi.query('file', 'upload').custom(pruneObsoleteRelationsQuery)();
// };
// const pruneObsoleteRelationsQuery = ({ model }) => {
// if (model.orm !== 'mongoose') {
// return Promise.resolve();
// }
// const models = Array.from(strapi.db.models.values());
// const modelsId = models.map(model => model.globalId);
// return model.updateMany(
// { related: { $elemMatch: { kind: { $nin: modelsId } } } },
// { $pull: { related: { kind: { $nin: modelsId } } } }
// );
// };
const registerPermissionActions = async () => {
const actions = [
{