Index v2 side effects (#14567)
# Introduction Honestly this implem is a mess, discussing a potential side effect handler with @weiko before the build and run that would handle each side effect per entity and operation Handling: - [ ] unique index is generated when a field is updated with the `isUnique` - [x] an index is generated when a relation is created - [x] search vector index creation on custom object creation - [x] renaming a field metadata or an object should re-create all related indexes which are composed by their namings - [x] delete object should remove any related indexes - [x] delete field should update related indexes ( if index ends up empty it should be removed ) - [ ] on object renaming that contains morph fields -> triggers update field -> trigger index recompute - [x] on update name renaming should recompute all related indexes ## TODO - [x] Integration testing - [ ] Refactor the index maps cache to be storing a `idsByObjectMetadataId` - [x] Refactor deterministic name to use order sorting - [x] Remove flat index from flat object ## What's next Will handle morph indexes in a new dedicated PR for the moment will stick to this Same for the cache improvement and uniqueness
This commit is contained in:
-1
@@ -24,6 +24,5 @@ export const ATTACHMENT_FLAT_OBJECT_MOCK = getFlatObjectMetadataMock({
|
||||
isLabelSyncedWithName: false,
|
||||
workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419',
|
||||
universalIdentifier: '20202020-bd3d-4c60-8dca-571c71d4447a',
|
||||
flatIndexMetadatas: [],
|
||||
flatFieldMetadatas: Object.values(ATTACHMENT_FLAT_FIELDS_MOCK),
|
||||
});
|
||||
|
||||
-1
@@ -24,6 +24,5 @@ export const COMPANY_FLAT_OBJECT_MOCK = getFlatObjectMetadataMock({
|
||||
isLabelSyncedWithName: false,
|
||||
workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419',
|
||||
universalIdentifier: '20202020-b374-4779-a561-80086cb2e17f',
|
||||
flatIndexMetadatas: [],
|
||||
flatFieldMetadatas: Object.values(COMPANY_FLAT_FIELDS_MOCK),
|
||||
});
|
||||
|
||||
-1
@@ -24,6 +24,5 @@ export const FAVORITE_FLAT_OBJECT_MOCK = getFlatObjectMetadataMock({
|
||||
isLabelSyncedWithName: false,
|
||||
workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419',
|
||||
universalIdentifier: '20202020-ab56-4e05-92a3-e2414a499860',
|
||||
flatIndexMetadatas: [],
|
||||
flatFieldMetadatas: Object.values(FAVORITE_FLAT_FIELDS_MOCK),
|
||||
});
|
||||
|
||||
-1
@@ -24,6 +24,5 @@ export const FAVORITE_FOLDER_FLAT_OBJECT_MOCK = getFlatObjectMetadataMock({
|
||||
isLabelSyncedWithName: false,
|
||||
workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419',
|
||||
universalIdentifier: '20202020-7cf8-401f-8211-a9587d27fd2d',
|
||||
flatIndexMetadatas: [],
|
||||
flatFieldMetadatas: Object.values(FAVORITE_FOLDER_FLAT_FIELDS_MOCK),
|
||||
});
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ export const getFlatObjectMetadataMock = (
|
||||
|
||||
return {
|
||||
flatFieldMetadatas: [],
|
||||
flatIndexMetadatas: [],
|
||||
|
||||
description: 'default flat object metadata description',
|
||||
icon: 'icon',
|
||||
id: faker.string.uuid(),
|
||||
|
||||
+1
-1
@@ -24,6 +24,6 @@ export const NOTE_FLAT_OBJECT_MOCK = getFlatObjectMetadataMock({
|
||||
isLabelSyncedWithName: false,
|
||||
workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419',
|
||||
universalIdentifier: '20202020-0b00-45cd-b6f6-6cd806fc6804',
|
||||
flatIndexMetadatas: [],
|
||||
|
||||
flatFieldMetadatas: Object.values(NOTE_FLAT_FIELDS_MOCK),
|
||||
});
|
||||
|
||||
+1
-1
@@ -24,6 +24,6 @@ export const NOTE_TARGET_FLAT_OBJECT_MOCK = getFlatObjectMetadataMock({
|
||||
isLabelSyncedWithName: false,
|
||||
workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419',
|
||||
universalIdentifier: '20202020-fff0-4b44-be82-bda313884400',
|
||||
flatIndexMetadatas: [],
|
||||
|
||||
flatFieldMetadatas: Object.values(NOTETARGET_FLAT_FIELDS_MOCK),
|
||||
});
|
||||
|
||||
-1
@@ -24,6 +24,5 @@ export const OPPORTUNITY_FLAT_OBJECT_MOCK = getFlatObjectMetadataMock({
|
||||
isLabelSyncedWithName: false,
|
||||
workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419',
|
||||
universalIdentifier: '20202020-9549-49dd-b2b2-883999db8938',
|
||||
flatIndexMetadatas: [],
|
||||
flatFieldMetadatas: Object.values(OPPORTUNITY_FLAT_FIELDS_MOCK),
|
||||
});
|
||||
|
||||
+1
-1
@@ -24,6 +24,6 @@ export const PERSON_FLAT_OBJECT_MOCK = getFlatObjectMetadataMock({
|
||||
isLabelSyncedWithName: false,
|
||||
workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419',
|
||||
universalIdentifier: '20202020-e674-48e5-a542-72570eee7213',
|
||||
flatIndexMetadatas: [],
|
||||
|
||||
flatFieldMetadatas: Object.values(PERSON_FLAT_FIELDS_MOCK),
|
||||
});
|
||||
|
||||
+1
-1
@@ -24,6 +24,6 @@ export const PET_FLAT_OBJECT_MOCK = getFlatObjectMetadataMock({
|
||||
isLabelSyncedWithName: false,
|
||||
workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419',
|
||||
universalIdentifier: 'd34e0f07-1b8c-4de0-938e-599cf05e1f7f',
|
||||
flatIndexMetadatas: [],
|
||||
|
||||
flatFieldMetadatas: Object.values(PET_FLAT_FIELDS_MOCK),
|
||||
});
|
||||
|
||||
+1
-1
@@ -24,6 +24,6 @@ export const ROCKET_FLAT_OBJECT_MOCK = getFlatObjectMetadataMock({
|
||||
isLabelSyncedWithName: false,
|
||||
workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419',
|
||||
universalIdentifier: 'd78ec657-74a4-4652-a350-1f44ff62970a',
|
||||
flatIndexMetadatas: [],
|
||||
|
||||
flatFieldMetadatas: Object.values(ROCKET_FLAT_FIELDS_MOCK),
|
||||
});
|
||||
|
||||
+1
-1
@@ -24,6 +24,6 @@ export const TASK_FLAT_OBJECT_MOCK = getFlatObjectMetadataMock({
|
||||
isLabelSyncedWithName: false,
|
||||
workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419',
|
||||
universalIdentifier: '20202020-1ba1-48ba-bc83-ef7e5990ed10',
|
||||
flatIndexMetadatas: [],
|
||||
|
||||
flatFieldMetadatas: Object.values(TASK_FLAT_FIELDS_MOCK),
|
||||
});
|
||||
|
||||
+1
-1
@@ -24,6 +24,6 @@ export const TASK_TARGET_FLAT_OBJECT_MOCK = getFlatObjectMetadataMock({
|
||||
isLabelSyncedWithName: false,
|
||||
workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419',
|
||||
universalIdentifier: '20202020-5a9a-44e8-95df-771cd06d0fb1',
|
||||
flatIndexMetadatas: [],
|
||||
|
||||
flatFieldMetadatas: Object.values(TASKTARGET_FLAT_FIELDS_MOCK),
|
||||
});
|
||||
|
||||
-1
@@ -24,6 +24,5 @@ export const TIMELINE_ACTIVITY_FLAT_OBJECT_MOCK = getFlatObjectMetadataMock({
|
||||
isLabelSyncedWithName: false,
|
||||
workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419',
|
||||
universalIdentifier: '20202020-6736-4337-b5c4-8b39fae325a5',
|
||||
flatIndexMetadatas: [],
|
||||
flatFieldMetadatas: Object.values(TIMELINEACTIVITY_FLAT_FIELDS_MOCK),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user