mirror of
https://github.com/strapi/strapi.git
synced 2025-08-30 19:56:05 +00:00
Clear upload bootstrap old mongoose code
This commit is contained in:
parent
fe4e355b24
commit
c3064a26d2
@ -24,7 +24,6 @@ module.exports = async () => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// await pruneObsoleteRelations();
|
|
||||||
await registerPermissionActions();
|
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 registerPermissionActions = async () => {
|
||||||
const actions = [
|
const actions = [
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user