Skip to content

Commit

Permalink
[backend] Put noFiltersChecking: true for more migrations (#4636)
Browse files Browse the repository at this point in the history
  • Loading branch information
richard-julien committed Dec 4, 2023
1 parent e40d0fe commit 68f5d4b
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const up = async (next) => {
filters: [{ key: buildRefRelationKey(RELATION_INDICATES), values: ['EXISTS'] }],
filterGroups: [],
};
const opts = { types: [ABSTRACT_STIX_CORE_OBJECT, ABSTRACT_STIX_CORE_RELATIONSHIP], filters, callback };
const opts = { types: [ABSTRACT_STIX_CORE_OBJECT, ABSTRACT_STIX_CORE_RELATIONSHIP], filters, noFiltersChecking: true, callback };
await elList(context, SYSTEM_USER, READ_DATA_INDICES, opts);
// Apply operations.
let currentProcessing = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const up = async (next) => {
filters: [{ key: 'fromType', values: [ENTITY_TYPE_IDENTITY_SECTOR] }],
filterGroups: [],
};
const opts = { types: [RELATION_LOCATED_AT], filters, callback };
const opts = { types: [RELATION_LOCATED_AT], filters, noFiltersChecking: true, callback };
await elList(context, SYSTEM_USER, READ_INDEX_STIX_CORE_RELATIONSHIPS, opts);
logApp.info(`[MIGRATION] Cleaning located-at relationships between Sectors and Locations done in ${new Date() - start} ms`);
next();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export const up = async (next) => {
filters: [{ key: 'event_type', values: ['merge'] }],
filterGroups: [],
},
noFiltersChecking: true,
orderBy: 'created_at',
orderMode: 'asc'
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ const createIndividualThreatCategories = async (context) => {
filters: [{ key: 'category', values: [group] }],
filterGroups: [],
};
const args = { connectionFormat: false, filters };
const args = { connectionFormat: false, filters, noFiltersChecking: true };
const vocabsFromGroup = await listAllEntities(context, SYSTEM_USER, [ENTITY_TYPE_VOCABULARY], args);
const groupExistingVocabs = (vocabsFromGroup ?? []).map((v) => ({ key: v.name, description: v.description, aliases: v.aliases }));
const groupVocabToMaintains = groupExistingVocabs.filter((g) => !individualVocabKeys.includes(g.key));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export const up = async (next) => {
indices: [READ_INDEX_STIX_META_OBJECTS],
connectionFormat: false,
filters,
noFiltersChecking: true,
});

const updateVocabulary = async (vocabulary) => {
Expand Down

0 comments on commit 68f5d4b

Please sign in to comment.