Steps to test

1. Run metadata migrations
2. Run sync-metadata on your workspace
3. Enable the following feature flags: 
IS_SEARCH_ENABLED
IS_QUERY_RUNNER_TWENTY_ORM_ENABLED
IS_WORKSPACE_MIGRATED_FOR_SEARCH
4. Type Cmd + K and search anything
This commit is contained in:
Marie
2024-10-03 17:18:49 +02:00
committed by GitHub
parent 4c250dd811
commit 5f9435c718
71 changed files with 1517 additions and 209 deletions

View File

@ -0,0 +1,22 @@
import { IndexType } from 'src/engine/metadata-modules/index-metadata/index-metadata.entity';
import { getColumnsForIndex } from 'src/engine/twenty-orm/utils/get-default-columns-for-index.util';
describe('getColumnsForIndex', () => {
it('should return ["deletedAt"] when indexType is undefined', () => {
const result = getColumnsForIndex();
expect(result).toEqual(['deletedAt']);
});
it('should return an empty array when indexType is IndexType.GIN', () => {
const result = getColumnsForIndex(IndexType.GIN);
expect(result).toEqual([]);
});
it('should return ["deletedAt"] when indexType is IndexType.BTREE', () => {
const result = getColumnsForIndex(IndexType.BTREE);
expect(result).toEqual(['deletedAt']);
});
});

View File

@ -0,0 +1,10 @@
import { IndexType } from 'src/engine/metadata-modules/index-metadata/index-metadata.entity';
export const getColumnsForIndex = (indexType?: IndexType) => {
switch (indexType) {
case IndexType.GIN:
return [];
default:
return ['deletedAt'];
}
};